mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-04-01 11:26:43 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
a1c22f79e4
commit
f94b14b338
@ -2,19 +2,20 @@ import math
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute
|
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute
|
||||||
|
|
||||||
|
|
||||||
def quantum_fourier_transform(number_of_qubits: int = 3) -> dict:
|
def quantum_fourier_transform(number_of_qubits: int = 3) -> dict:
|
||||||
"""
|
"""
|
||||||
Build and simulate the Quantum Fourier Transform (QFT) circuit
|
Build and simulate the Quantum Fourier Transform (QFT) circuit
|
||||||
for a given number of qubits using the Qiskit framework.
|
for a given number of qubits using the Qiskit framework.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
number_of_qubits (int): The number of qubits for the QFT circuit.
|
number_of_qubits (int): The number of qubits for the QFT circuit.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
dict: A dictionary containing the counts of measurement results.
|
dict: A dictionary containing the counts of measurement results.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
ValueError: If the number of qubits is less than or equal to 0,
|
ValueError: If the number of qubits is less than or equal to 0,
|
||||||
greater than 10, or not an integer.
|
greater than 10, or not an integer.
|
||||||
TypeError: If the input is not an integer.
|
TypeError: If the input is not an integer.
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user