Skip to content

Commit

Permalink
Merge pull request #8 from JiihwanKim/master
Browse files Browse the repository at this point in the history
Remove the dependency of backend updates by IBMQ
  • Loading branch information
ozaner authored Jul 15, 2022
2 parents 851a1d6 + 25c627e commit a4c6851
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions qrng/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,13 @@ def _set_qubits(n):
def set_backend(b = 'qasm_simulator'):
global _backend
global provider
if b == 'ibmq_london' or b == 'ibmq_burlington' or b == 'ibmq_essex'\
or b == 'ibmq_ourense' or b == 'ibmq_vigo' or b == 'ibmqx2' :
available_backends = provider.backends(b, filters = lambda x: x.status().operational == True)
if (b is not '') and (b in str(available_backends)):
_backend = provider.get_backend(b)
_set_qubits(5)
elif b == 'ibmq_16_melbourne':
_backend = provider.get_backend(b)
_set_qubits(15)
elif b == 'ibmq_armonk':
_backend = provider.get_backend(b)
_set_qubits(1)
elif b == 'ibmq_qasm_simulator':
_backend = provider.get_backend(b)
_set_qubits(32)
else:
print(str(b)+' is not available. Backend is set to qasm_simulator.')
_backend = qiskit.BasicAer.get_backend('qasm_simulator')
_set_qubits(8)
_set_qubits(_backend.configuration().n_qubits)

# Strips QISKit output to just a bitstring.
def _bit_from_counts(counts):
Expand Down

0 comments on commit a4c6851

Please sign in to comment.