Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First wave of examples that pretty much go over basic API usage #78

Merged
merged 2 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading