Chapter 9 – Simulating Quantum Systems and Noise Models
Question 1
Can you list all the simulators found in the Qiskit Aer module?
Answer
The list of simulators can be generated using the Aer.backends()
function.
Question 2
Create a qsphere representation of a qubit on the negative Y axis, creating the state , using only a single Hadamard gate along with the phase gates.
Answer
In order to accomplish this, you will need to set the qubit in a superposition state. This can be done using the Hadamard gate (H), which will place the qubit in the state . After that, we will have to run a phase shift from the
state to the
state, which would mean we need a phase gate to shift the state by a phase of
, as follows:
qc = QuantumCircuit(1)
qc.h(0)
qc.sdg(0)
simulator = Aer.get_backend('statevector_simulator')
transpiled_qc = transpile(qc, backend=simulator)
result = simulator.run(transpiled_qc).result()
statevector = result.get_statevector(transpiled_qc...