- Basic things to do for an experiment
- 1. Initialize
- 2. Drawing Circuits
- 3. Connecting to Backend/device/simulator
- 4. How to retrieve results after experiment
- 5. How to plot data
- Create the Circuit
- use the initializer function =
circuit.initialize([a,b],which_qubit)
where a,b are coefficients of 0 and 1 respectively for a initial state$a|0\rangle + b|1\rangle$
- By default its all qubits are initialized to
$|0\rangle$ state - for a superposition add a Hadamard gate to get
$\frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$ state
- use
sv = Statevector.from_label('000')
= to create a labelled state$|000\rangle$ - use
sv.evolve(circuit)
= to evolve the qubits based on a circuit then plot the results - get the data using
sv.data
- plot it using the visualization tools
NOTE : You can run experiments only until you have credits , once credits run out you cannot submit jobs. Credits get refreshed after a job completes