Open king-p3nguin opened 7 months ago
@king-p3nguin
Hi! I have a question about one of the methods you show.
Would you explain the more detail of .to_dict()
? I don't grasp the overview of this method.
@masa10-f I was thinking of what Qiskit does in its method: https://qiskit.org/documentation/stubs/qiskit.quantum_info.Statevector.html#qiskit.quantum_info.Statevector.to_dict
The only difference is that graphix adopts bit-endian, whereas Qiskit uses little-endian.
The following methods may improve the utility of
Statevec
:.inner()
: calculate the inner product of two state vectorsnp.abs(np.dot(sv1.flatten().conjugate(), sv2.flatten()))
.equiv()
: checks the equality of two state vectors up to the global phaseatol
andrtol
to parameters to set precisionignore_global_phase
option to ignore the global phase, setTrue
as default.draw()
: show state vector in latex format (in jupyter notebook) or text (in command line)format
to parameter ("latex"
or"text"
).to_dict()
: convertStatevec
todict
format