Skip to content

Wrong sign in a single-gate-circuit statevector? #124

Answered by yangcal
yapolyak asked this question in Q&A
Discussion options

You must be logged in to vote

Hello Iakov,

The expected input form is described in our documentation here.

If this is unclear to python users working on tensor objects, let's use an example here: If you have a n-qubit gate acting on qubit (a,b,c,...), the API state_apply_tensor is expecting an operand with mode indices ...cba...CBA where ...cba are the contracted ket indices and ...CBA are the un-contracted bra indices. The reason why we picked this convention is explain in the documentation but we do understand that this felt less intuitive for python users.

Going back your case, in your reference code, essentially what you're computing as reference amounts to

sv = np.einsum('ab,Aa->Ab', sv_vacuum, gate_rx)

So you se…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@yapolyak
Comment options

Answer selected by yapolyak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #123 on March 05, 2024 16:44.