Basic circuit execution

This notebooks illustrates how you can run your qiskit code on the Quantum Inspire platform.

This notebook makes the following assumptions:

  • The qi cli tool is installed and you are logged in, see these instructions

  • account exists on the Quantum Inspire platform

  • qiskit plugin installed (pip install qiskit-quantuminspire) in the same environment as this notebook

The necessary imports

from qiskit import QuantumCircuit

from qiskit_quantuminspire.qi_provider import QIProvider

What QI Backends are available?

provider = QIProvider()

# Show all current supported backends:
print(provider.backends())

Create your Qiskit Circuit

Let’s create a bell state circuit.

circuit = QuantumCircuit(3, 10)
circuit.h(0)
circuit.cx(0, 1)
circuit.measure(0, 0)
circuit.measure(1, 1)

Create the Job in the Quantum Inspire Platform

On the appropriate backend, you run your circuit. Be aware that if your circuit contains gates that are not supported by the target, compilation errors may arise.

backend = provider.get_backend(name="QX emulator")
job = backend.run(circuit, shots=1024)

Obtain the result

After a while the result should be available. Depending on the current load, the time for completion may vary.

result = job.result()
print(result)