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

[QHC-777] Major refactor to simplify things #820

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
635bdc7
major refactor to simplify things
fedonman Oct 15, 2024
c1dea67
Merge branch 'main' into qhc-777-add-channel_ids-for-all-instruments-…
fedonman Oct 15, 2024
503f82a
various fixes
fedonman Oct 15, 2024
6b461fc
Merge branch 'qhc-777-add-channel_ids-for-all-instruments-connected-t…
fedonman Oct 15, 2024
c83fd11
various changes
fedonman Oct 16, 2024
c438d10
merge from main
fedonman Oct 17, 2024
248c1bb
update tests
fedonman Oct 17, 2024
eb0364d
update tests
fedonman Oct 17, 2024
2b3a270
fix circuit_transpiler tests
fedonman Oct 18, 2024
e2a500d
add decorators to instrument methods
fedonman Oct 18, 2024
36e348f
delete obsolete Pulsar
fedonman Oct 18, 2024
42a7171
refactor qblox_module tests
fedonman Oct 18, 2024
ffca2a5
fix instruments tests
fedonman Oct 21, 2024
3b46192
fix tests
fedonman Oct 21, 2024
4dbc788
fix tests
fedonman Oct 22, 2024
abad77f
fix tests
fedonman Oct 22, 2024
f663725
fix documentation
fedonman Oct 22, 2024
8679655
fix runcard for calibration tests
fedonman Oct 22, 2024
6e7b5a3
delete obsolete files, fix mypy
fedonman Oct 22, 2024
ce23239
improve codecov
fedonman Oct 22, 2024
1fe3a14
improve codecov
fedonman Oct 22, 2024
7a0f9f7
add changelog entry
fedonman Oct 23, 2024
d99f918
add changelog entry
fedonman Oct 23, 2024
cfadbfd
re-enable mypy in precommit
fedonman Oct 23, 2024
36ee35a
rename circuit_transpiler module to digital
fedonman Oct 23, 2024
e6f08c4
delete drivers module
fedonman Oct 23, 2024
50dadf1
add topology to digital_compilation_settings
fedonman Oct 23, 2024
fe19ad8
update changelog
fedonman Oct 23, 2024
c220180
fix documentation
fedonman Oct 23, 2024
664ecd3
fix is_awg/is_adc docstrings
fedonman Oct 23, 2024
4ac0802
improve qblox_compiler tests
fedonman Oct 24, 2024
30b39f3
improve tests
fedonman Oct 24, 2024
6993af3
improve tests
fedonman Oct 24, 2024
b40b6ea
improve QCM/QRM RF modules and relevant tests
fedonman Oct 24, 2024
d92fb67
improve qblox tests
fedonman Oct 24, 2024
f9bfd0d
improve qblox tests
fedonman Oct 24, 2024
ecfb3c1
improve tests
fedonman Oct 24, 2024
11d249d
improve tests
fedonman Oct 24, 2024
49f4436
improve tests
fedonman Oct 24, 2024
40342e5
improve tests
fedonman Oct 24, 2024
47d421d
improve tests
fedonman Oct 24, 2024
0ce50e1
improve tests
fedonman Oct 25, 2024
76f59d2
add ignore to codecov
fedonman Oct 25, 2024
b137afd
improve tests
fedonman Oct 25, 2024
e7ea978
delete commented test file
fedonman Oct 29, 2024
39c0f92
change import names for qibo gates
fedonman Oct 29, 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
6 changes: 5 additions & 1 deletion .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ coverage:
target: 100% # make sure coverage of new lines is 100%
flags:
- "unittests"

notify:
slack:
default:
Expand All @@ -33,3 +32,8 @@ coverage:
- "unittests"
paths:
- "src"

ignore:
- "src/qililab/instruments/keithley/keithley_2600.py"
fedonman marked this conversation as resolved.
Show resolved Hide resolved
- "src/qililab/instruments/qblox/qblox_d5a.py"
- "src/qililab/instruments/qblox/qblox_s4g.py"
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
rev: "v1.11.2"
hooks:
- id: mypy
args: [--no-strict-optional, --ignore-missing-imports]
args: ["--no-strict-optional", "--ignore-missing-imports", "--config-file=pyproject.toml"]
additional_dependencies: []

- repo: https://github.com/executablebooks/mdformat
Expand Down
File renamed without changes.
4 changes: 0 additions & 4 deletions docs/code/chip.rst

This file was deleted.

4 changes: 0 additions & 4 deletions docs/code/drivers.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/code/transpiler.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ql.transpiler
===============

.. automodule:: qililab.circuit_transpiler
.. automodule:: qililab.digital
2 changes: 0 additions & 2 deletions docs/fundamentals/platform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ The platform represents the laboratory setup used to control the quantum devices

The :class:`.Platform` object is the responsible for managing the initializations, connections, setups, and executions of the laboratory, which mainly consists of:

- :class:`.Chip`

- Buses

- Instruments
Expand Down
3 changes: 0 additions & 3 deletions docs/fundamentals/runcard.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ They contain all the laboratory information, settings and parameters, concretely

- Gates transpilation

- :class:`.Chip`

- Instruments

- Buses
Expand Down Expand Up @@ -206,7 +204,6 @@ Runcard YAML file example:
alias: QRM1
firmware: 0.7.0
num_sequencers: 2
acquisition_delay_time: 100
out_offsets: [0, 0]
awg_sequencers:
- identifier: 0
Expand Down
2 changes: 0 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ Qililab Documentation

code/ql
code/calibration
code/chip
code/drivers
code/platform
code/pulse
code/qprogram
Expand Down
17 changes: 17 additions & 0 deletions docs/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,23 @@
- Renamed the platform's `execute_anneal_program()` method to `execute_annealing_program()` and updated its parameters. The method now expects `preparation_block` and `measurement_block`, which are strings used to retrieve blocks from the `Calibration`. These blocks are inserted before and after the annealing schedule, respectively.
[#816](https://github.com/qilimanjaro-tech/qililab/pull/816)

- **Major reorganization of the library structure and runcard functionality**. Key updates include:

- Removed obsolete instruments, such as VNAs.
- Removed the `drivers` module.
- Simplified the `Qblox` sequencer class hierarchy into two main classes: `QbloxSequencer` and `QbloxADCSequencer`.
- Removed `SystemController` and `ReadoutSystemController`; buses now interface directly with instruments.
- Introduced a new `channels` attribute to the `Bus` class, allowing specification of channels for each associated instrument.
- Removed the `Chip` class and its related runcard settings.
- Eliminated outdated settings, such as instrument firmware.
- Refactored runcard settings into a modular structure with four distinct groups:
- `instruments` and `instrument_controllers` for lab instrument setup.
- `buses` for grouping instrument channels.
- `digital` for digital compilation settings (e.g., Qibo circuits).
- `analog` for analog compilation settings (e.g., annealing programs).

[#820](https://github.com/qilimanjaro-tech/qililab/pull/820)

### Deprecations / Removals

### Documentation
Expand Down
1 change: 0 additions & 1 deletion examples/runcards/galadriel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ instruments:
alias: QRM1
firmware: 0.7.0
num_sequencers: 5
acquisition_delay_time: 100
out_offsets: [0, 0]
awg_sequencers:
- identifier: 0
Expand Down
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
line-length = 120
output-format = "concise"
target-version = "py310"
extend-exclude = ["test_*.py", "data.py"]

[tool.ruff.lint]
preview = true
Expand Down Expand Up @@ -76,6 +77,7 @@ ignore = [
dummy-variable-rgx = "^_$"
logger-objects = ["qililab.logger"]


[tool.ruff.lint.per-file-ignores]
"tests/*" = ["ANN", "S", "CPY", "SLF001", "PLR", "DOC", "RUF012"]
"docs/*" = ["CPY"]
Expand All @@ -101,7 +103,7 @@ warn_return_any = false
ignore_missing_imports = true
exclude = [
"\\.ipynb$",
"tests/*"
"^tests/.*"
]

[tool.commitizen]
Expand Down Expand Up @@ -140,7 +142,11 @@ tag_format = "$version"
"*/virtualenv/*",
"*/virtualenvs/*",
"*/tests/*",
"examples/*"
"examples/*",
# TODO: Remove these once we modernize instruments
"src/qililab/instruments/keithley/keithley_2600.py",
fedonman marked this conversation as resolved.
Show resolved Hide resolved
"src/qililab/instruments/qblox/qblox_d5a.py",
"src/qililab/instruments/qblox/qblox_s4g.py"
]

[tool.nbqa.md]
Expand Down
7 changes: 2 additions & 5 deletions src/qililab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
from .data_management import build_platform, load_results, save_platform, save_results
from .execute_circuit import execute
from .qprogram import Calibration, CrosstalkMatrix, Domain, QbloxCompiler, QProgram, QuantumMachinesCompiler, Experiment
from .result import ExperimentResults, Results, stream_results
from .result import ExperimentResults, stream_results
from .typings import Parameter
from .utils import Loop
from .utils.serialization import serialize, serialize_to, deserialize, deserialize_from
from .waveforms import IQPair, Square, Gaussian, FlatTop, Arbitrary, DragCorrection, Waveform, Ramp, Chained

# moving circuit_transpiler module imports here because it has instruments module dependencies so circular imports can be avoided
from .circuit_transpiler import Drag, Wait
from .digital import Drag, Wait
from .analog import AnnealingProgram # same as circuit transpiler, top modules should be imported at top


Expand All @@ -47,13 +46,11 @@
"FlatTop",
"Gaussian",
"IQPair",
"Loop",
"Parameter",
"QProgram",
"QbloxCompiler",
"QuantumMachinesCompiler",
"Ramp",
"Results",
"Square",
"Wait",
"Waveform",
Expand Down
4 changes: 2 additions & 2 deletions src/qililab/analog/annealing_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import numpy as np

from qililab.qprogram import CrosstalkMatrix, FluxVector
from qililab.settings.runcard import Runcard
from qililab.settings.analog import FluxControlTopology
from qililab.waveforms import Arbitrary


Expand All @@ -44,7 +44,7 @@ class AnnealingProgram:

def __init__(
self,
flux_to_bus_topology: list[Runcard.FluxControlTopology],
flux_to_bus_topology: list[FluxControlTopology],
annealing_program: list[dict[str, dict[str, float]]],
):
"""Init method"""
Expand Down
64 changes: 0 additions & 64 deletions src/qililab/chip/__init__.py

This file was deleted.

Loading
Loading