-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First wave of examples that pretty much go over basic API usage
- Loading branch information
1 parent
0b2b635
commit 852f2e1
Showing
17 changed files
with
42 additions
and
145 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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") |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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) |
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
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) |
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
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)) |
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
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) |