I encounter a sign problem in implementing the Qiskit Statevector simulator.
Here is my code:
from qiskit_aer import AerSimulator, StatevectorSimulator from qiskit import QuantumCircuit, BasicAer, execute import numpy as np circuit = QuantumCircuit(1) circuit.save_statevector('psi0') circuit.rz(2*math.pi, 0) circuit.save_statevector('psi1') simulator = StatevectorSimulator() result = execute(circuit, simulator_aerlegacy).result() data = result.data() psi0 = data['psi0'] psi1 = data['psi1'] np.inner(psi0, psi1)
I expect the inner product to be "-1" as the "rz(2*math.pi, 0)" is [[-1,0],[0,-1]]. However, the result turns out to be "+1".
I checked the state vectors of "psi0" and "psi1". I have
Statevector([-1.+1.2246468e-16j, -0.+0.0000000e+00j], dims=(2,))
Statevector([-1.+1.2246468e-16j, -0.+0.0000000e+00j], dims=(2,)).
There is an unexpected negative sign for the state vector "psi0".
Does anyone know why this sign problem happens and how to address this "sign problem" in implementing the Qiskit Statevector simulator?
Thanks a lot!