Created
May 26, 2023 11:22
-
-
Save JesusCastroFernandez/4cacb29402b468453b0fa4072c306b69 to your computer and use it in GitHub Desktop.
Ejemplo de código para el algoritmo de Shor.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from qiskit import QuantumCircuit, Aer, execute | |
from qiskit.aqua import QuantumInstance | |
from qiskit.aqua.algorithms import Shor | |
n = 15 | |
a = 2 | |
backend = Aer.get_backend('qasm_simulator') | |
quantum_instance = QuantumInstance(backend, shots=1024) | |
shor = Shor(N=n, a=a, quantum_instance=quantum_instance) | |
result = shor.run() | |
print(result['factors']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment