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

qnn.py update for most recent versions of Cirq (v0.11+) #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

qlero
Copy link

@qlero qlero commented Mar 19, 2022

Hello,

As discussed in issues, here is a pull request with a small update on chapter 9's qnn.py script.
The following changes have been made:

  1. (add-on compared to opened issue) Removal of TwoQubitGate from the inheritance arguments of class ZXGate (lines 10-11) as it will be deprecated with cirq v0.14 onward. This is replaced with overriding the function _num_qubits_ in the body of the class such that:
def _num_qubits_(self):
        return 2
  1. Addition of the recursive:bool argument to the override of the function _resolve_parameters_ (line 36) in the body of custom class ZXGate so as to work with cirq versions v0.11 and further.
  2. Replacement of wf = result.final_state with wf = result.final_state_vector (line 79) in the body of function readout_expectation.

Best regards,

Quentin

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

Successfully merging this pull request may close these issues.

None yet

1 participant