bachelor_thesis/presentation/example_graphs/circuit_EPR_state.py

18 lines
542 B
Python
Raw Normal View History

2020-04-15 14:02:38 +00:00
from collections import deque
import matplotlib.pyplot as plt
import numpy as np
import json
from pyqcs import State, H, X, S, CZ, CX, list_to_circuit
from pyqcs.graph.state import GraphState
from pyqcs.util.to_diagram import circuit_to_diagram
circuit = (H(0)
| list_to_circuit([CX(i, 0) for i in range(1, 5)]))
#circuit = (list_to_circuit([H(i) for i in range(0, 5)])
# | list_to_circuit([CZ(i, 0) for i in range(1, 5)])
# | list_to_circuit([H(i) for i in range(1, 5)]))
print(circuit_to_diagram(circuit))