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

Cqt 129 use supports float class #361

Open
wants to merge 27 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d1bef19
[CQT 126] Verify dataclasses using __post_init__ (#319) (#321)
juanboschero Sep 9, 2024
3b30578
[CQT-127] Allow Qubit to accept QubitLike
Sep 11, 2024
fac9e37
Accept QubitLike throughout opensquirrel
Sep 12, 2024
0f22ff8
Happify ruff
Sep 12, 2024
1e34bed
Implement QubitLike
S-Linde Sep 19, 2024
40653f8
Happify ruff
S-Linde Sep 19, 2024
469d432
Docstrings
S-Linde Sep 19, 2024
06eccea
Happify ruff
S-Linde Sep 19, 2024
eb28ad7
Remove redundend Qubit from OS
S-Linde Sep 20, 2024
182bd5f
Removed redundant Qubit statements from example
S-Linde Sep 20, 2024
d43a52e
Fix named measurements and reset
S-Linde Sep 20, 2024
a9f4b41
Removed redundant Qubit statements from tests
S-Linde Sep 20, 2024
7a9db53
Update Float object
S-Linde Sep 20, 2024
1caef94
Update named_gate wrapper to correctly parse SupportsFloat object
S-Linde Sep 20, 2024
f0e81d3
Update statements to accept SupportsFloat
S-Linde Sep 20, 2024
da4f857
Make docstring a raw string
S-Linde Sep 20, 2024
843fe84
Update default gates to use SupportsFloat
S-Linde Sep 20, 2024
9c92d00
Update tutorial
S-Linde Sep 20, 2024
7f532b4
Remove Float from README.md
S-Linde Sep 20, 2024
26c18c2
Remove Float from notebook
S-Linde Sep 20, 2024
63c0c8a
Remove Float from decomposers
S-Linde Sep 20, 2024
ceed8ee
Use SupportsFloat in writer
S-Linde Sep 20, 2024
479095a
Remove Float from tests that don't use it
S-Linde Sep 20, 2024
5e27601
Happify ruff
S-Linde Sep 20, 2024
5017993
ruff
S-Linde Sep 20, 2024
7b6b1b4
Resolve merge conflicts
S-Linde Oct 16, 2024
a660e99
Remove unneeded Float imports
S-Linde Oct 16, 2024
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ Here is an example of building a circuit using the `CircuitBuilder`:
```python
import math
from opensquirrel.circuit_builder import CircuitBuilder
from opensquirrel.ir import Qubit, Float
from opensquirrel.ir import Qubit

# Initialize the builder and build your circuit
builder = CircuitBuilder(qubit_register_size=1)
builder.H(Qubit(0)).Z(Qubit(0)).Y(Qubit(0)).Rx(Qubit(0), Float(math.pi / 3))
builder.H(Qubit(0)).Z(Qubit(0)).Y(Qubit(0)).Rx(Qubit(0), math.pi / 3)

# Get the circuit from the circuit builder
qc = builder.to_circuit()
Expand Down
7 changes: 3 additions & 4 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,9 @@ For creation of a circuit through Python, the `CircuitBuilder` can be used accor

```python
from opensquirrel import CircuitBuilder
from opensquirrel.ir import Float

builder = CircuitBuilder(qubit_register_size=2)
builder.Ry(0, Float(0.23)).CNOT(0, 1)
builder.Ry(0, 0.23).CNOT(0, 1)
qc = builder.to_circuit()

print(qc)
Expand Down Expand Up @@ -186,7 +185,7 @@ import math

builder = CircuitBuilder(1)
for _ in range(4):
builder.Rx(0, Float(math.pi / 4))
builder.Rx(0, math.pi / 4)
qc = builder.to_circuit()

qc.merge_single_qubit_gates()
Expand Down Expand Up @@ -363,7 +362,7 @@ an example can be seen below where a Hadamard, Z, Y and Rx gate are all decompos
from opensquirrel.decomposer.aba_decomposer import ZYZDecomposer

builder = CircuitBuilder(qubit_register_size=1)
builder.H(0).Z(0).Y(0).Rx(0, Float(math.pi / 3))
builder.H(0).Z(0).Y(0).Rx(0, math.pi / 3)
qc = builder.to_circuit()

qc.decompose(decomposer=ZYZDecomposer())
Expand Down
Loading
Loading