Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qiskit version of sample 3-5 #18

Open
machinelevel opened this issue Jan 23, 2020 · 0 comments
Open

Qiskit version of sample 3-5 #18

machinelevel opened this issue Jan 23, 2020 · 0 comments
Assignees

Comments

@machinelevel
Copy link
Contributor

(sent by a reader to @mercedesGS)

I believe that there is an error with QISKIT sample code at 3-5.

# Example 3-5: Custom conditional-phase
# Set up the program
reg = QuantumRegister(2, name='reg')
qc = QuantumCircuit(reg)

theta = math.pi / 2
qc.h(reg)
qc.rz(theta/2, reg[1])
qc.cx(reg[0], reg[1])
qc.rz(-theta/2, reg[1])
qc.cx(reg[0], reg[1])
qc.rz(-theta/2, reg[0])

I believe that the sign of last theta shall be ‘theta/2’ rather than ‘-theta/2’

Please let me know your thought.

@machinelevel machinelevel self-assigned this Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant