You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hope all are well. I had a quick question I was hoping to ask. I understand there are two ways we can generate the unitary of a circuit. One is using qiskit.quantum_info.Operator, and the other is using AerSimulator like so:
# Construct quantum circuit without measurecirc=QuantumCircuit(2)
circ.h(0)
circ.cx(0, 1)
circ.save_unitary()
# Transpile for simulatorsimulator=AerSimulator(method='unitary')
circ=transpile(circ, simulator)
# Run and get unitaryresult=simulator.run(circ).result()
unitary=result.get_unitary(circ)
print("Circuit unitary:\n", np.asarray(unitary).round(5))
I was wondering what the main difference between the two approaches is, and if someone wants to generate the unitary (which is admittedly an expensive operation as we have to contract all the gates together) if they can do so using GPU (and whether this is then only doable with AerSimulator and thus the difference).
The text was updated successfully, but these errors were encountered:
I think it is better to use qiskit.quantum_info for smaller number of qubits, but Aer is suitable to make large unitary matrix, because Aer has some overheads. I think if you want to make > 7qubits unitary matrix, Aer will be faster
Informations
Greetings there,
Hope all are well. I had a quick question I was hoping to ask. I understand there are two ways we can generate the unitary of a circuit. One is using
qiskit.quantum_info.Operator
, and the other is using AerSimulator like so:I was wondering what the main difference between the two approaches is, and if someone wants to generate the unitary (which is admittedly an expensive operation as we have to contract all the gates together) if they can do so using GPU (and whether this is then only doable with AerSimulator and thus the difference).
The text was updated successfully, but these errors were encountered: