Created
March 3, 2019 02:11
-
-
Save rish-16/797ca0cb31560760e069a5d30c0f51e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cirq | |
# Build a model using Circuits | |
circuit = cirq.Circuit() | |
# Create Qubits | |
(q0, q1) = cirq.LineQubit.range(2) | |
# Add Qubits to Circuit model using logic gates | |
circuit.append([cirq.H(q0), cirq.CNOT(q0, q1)]) | |
# Measure the final values of the Qubits | |
circuit.append([cirq.measure(q0), cirq.measure(q1)]) | |
# Visualising the Circuit | |
print (circuit) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment