So the documentation is all mixed up and I can't find how to get unitaries, statevectors, etc. in the AerSimulator
module. For an example, see e.g. this docs. In the old days, one would get this information using only the Aer
module (as described in the previous link). But now, fresh qiskit installations do not recognize the Aer
module and instead one has to use the "AerSimulator
" module. If my circuit is
qreg_q = QuantumRegister(1, 'q')
creg_c = ClassicalRegister(1, 'c')
circuit = QuantumCircuit(qreg_q, creg_c)
circuit.h(0)
I call the "backend" as (not sure if correctly)
backend = AerSimulator(method='unitary')
and run
job = backend.run(circuit).result()
The job
object has the attribute (?) job.get_unitary()
, but I can't get the unitary matrix from it. Any idea how to extract this information?