Skip to content

Commit

Permalink
First wave of examples that pretty much go over basic API usage
Browse files Browse the repository at this point in the history
  • Loading branch information
brennanfreeze committed Sep 16, 2024
1 parent 0b2b635 commit 852f2e1
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 145 deletions.
13 changes: 0 additions & 13 deletions examples/controlledphasegate.py

This file was deleted.

3 changes: 3 additions & 0 deletions examples/create_quantum_circuit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from qcpy import quantumciruit

qc = quantumciruit(qubits=4, big_endian=True, prep="z")
7 changes: 0 additions & 7 deletions examples/createcircuit.py

This file was deleted.

13 changes: 0 additions & 13 deletions examples/entangledqubits.py

This file was deleted.

9 changes: 0 additions & 9 deletions examples/hadamard.py

This file was deleted.

11 changes: 0 additions & 11 deletions examples/hadamardstate.py

This file was deleted.

12 changes: 0 additions & 12 deletions examples/qsphere.py

This file was deleted.

11 changes: 0 additions & 11 deletions examples/quantumentanglement.py

This file was deleted.

19 changes: 0 additions & 19 deletions examples/reversecnot.py

This file was deleted.

8 changes: 8 additions & 0 deletions examples/show_quantum_circuit_drawing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from qcpy import quantumcircuit


qc = quantumcircuit(qubits=5, big_endian=True)

qc.h([i for i in range(5)])
qc.cnot(0, 4)
print(qc)
26 changes: 0 additions & 26 deletions examples/statevector.py

This file was deleted.

11 changes: 0 additions & 11 deletions examples/swapgate.py

This file was deleted.

13 changes: 0 additions & 13 deletions examples/toffoli.py

This file was deleted.

10 changes: 10 additions & 0 deletions examples/use_custon_quantum_gates.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from qcpy import quantumcircuit
import numpy as numpy


pauli_x = np.array([[0 + 0j, 1 + 0j], [1 + 0j, 0 + 0j]], "F")

qc = quantumcircuit(qubits=4, big_endian=True, prep="y")

qc.custom(3, pauli_x)
print(qc)
6 changes: 6 additions & 0 deletions examples/use_quantum_gates.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from qcpy import quantumcircuit, gates

qc = quantumcircuit(qubits=4, big_endian=False)

qc.custom(gates.paulix(), 0)
print(qc)
8 changes: 8 additions & 0 deletions examples/use_quantum_tools.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from qcpy import quantumcircuit, amplitude

qc = quantumcircuit(qubits=4, big_endian=False)

qc.h(3)
qc.x(0)
qc.x(3)
print(ampltiude(qc))
7 changes: 7 additions & 0 deletions examples/use_visualize_quantum_circuit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from qcpy import quantumcircuit, visualize

qc = quantumcircuit(qubits=4)

qc.h([i for i in range(4)])

visualize.qsphere(qc)

0 comments on commit 852f2e1

Please sign in to comment.