Qiskit is an open-source SDK for working with quantum computers at the level of circuits, algorithms, and application modules.
This project contains a provider that allows access to Quantum Inspire quantum systems.
...
You can install the provider using pip:
pip install qiskit-quantuminspire
To instantiate the provider, make sure you have an access token then create a provider:
from qiskit_quantuminspire import QIProvider
provider = QIProvider()
Once the provider has been instantiated, it may be used to access supported backends:
# Show all current supported backends:
print(provider.backends())
# Get Quantum Inspire's simulator backend:
simulator_backend = provider.get_backend("QX emulator")
Once a backend has been specified, it may be used to submit circuits. For example, running a Bell State:
from qiskit import QuantumCircuit
# Create a basic Bell State circuit:
qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
qc.measure([0, 1], [0, 1])
# Run the circuit on Quantum Inspire's platform:
job = simulator_backend.run(qc)
# Print the results.
print(job.result().get_counts())
# Get results with a different aggregation method when debiasing
# is applied as an error mitigation strategy
print(job.result(sharpen=True).get_counts())
# The simulator specifically provides the the ideal probabilities and creates
# counts by sampling from these probabilities. The raw probabilities are also accessible:
print(job.result().get_probabilities())
...
This package uses the pytest test runner, and other packages
for mocking interfactions, reporting coverage, etc.
These can be installed with poetry install
.
To use pytest directly, just run:
tox -e test