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:
(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
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.
Replacement of wf = result.final_state with wf = result.final_state_vector (line 79) in the body of function readout_expectation.
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:TwoQubitGate
from the inheritance arguments of classZXGate
(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:recursive:bool
argument to the override of the function_resolve_parameters_
(line 36) in the body of custom classZXGate
so as to work with cirq versions v0.11 and further.wf = result.final_state
withwf = result.final_state_vector
(line 79) in the body of functionreadout_expectation
.Best regards,
Quentin