I am trying to create this state: rho = = q . rho_{1,2} + r . rho_{2,3} + s . rho{1,3} + (1-q-r-s) . rho_separable
And I wrote this code:
import random
import numpy as np
import cirq
circuit, circuit2, circuit3 = cirq.Circuit()
p = 0.2
q = 0.1
r = 0.3
alice, bob, charlie = cirq.LineQubit.range(1, 4)
rho_12 = circuit.append([cirq.H(alice), cirq.CNOT(alice, bob)])
#circuit.append([cirq.H(alice), cirq.CNOT(alice, bob)])
rho_23 = circuit.append([cirq.H(bob), cirq.CNOT(bob, charlie)])
rho_13 = circuit.append([cirq.H(alice), cirq.CNOT(alice, charlie)])
circuit = rho_12 + rho_23 + rho_13
print(circuit)
In here I have 2 problem:
1)This line is not working: circuit = rho_12 + rho_23 + rho_13
2)I cannot multiply the state with p or q or r. What I mean is that I can't write this line:
rho_12 = circuit.append([cirq.H(alice), cirq.CNOT(alice, bob)]) * q
Could you please show me how I can write this state?
circuit
variable already; no need to add those things together. $\endgroup$multiplied_circuit = cirq.Circuit(op1, op2) * 3
. $\endgroup$