Skip to content

Commit

Permalink
Fix/remove qm-qua 1.2.0 deprecations (#223)
Browse files Browse the repository at this point in the history
* Address QuantumMachine and QuantumMachinesManager deprecations in qm.qua==1.1.2

* Add changes to CHANGELOG.

* Fix import for QmJob.
  • Loading branch information
deanpoulos authored Jun 28, 2024
1 parent 44b38ef commit 2c07e63
Show file tree
Hide file tree
Showing 19 changed files with 28 additions and 26 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]
### Fixed
- Fix deprecated imports in preparation for qm-qua version 1.2.0

## [0.17.5] - 2024-06-26
### Fixed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from qm.qua import *
from qm.QuantumMachinesManager import QuantumMachinesManager
from qm import QuantumMachinesManager
from time import sleep
from configuration import *
from qualang_tools.callable_from_qua import *
Expand Down
2 changes: 1 addition & 1 deletion examples/callable_from_qua/qua_print.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from qm.qua import *
from qm.QuantumMachinesManager import QuantumMachinesManager
from qm import QuantumMachinesManager
from configuration import *
from qualang_tools.callable_from_qua import callable_from_qua, patch_qua_program_addons

Expand Down
2 changes: 1 addition & 1 deletion examples/callable_from_qua/update_other_instruments.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from qm.qua import *
from qm.QuantumMachinesManager import QuantumMachinesManager
from qm import QuantumMachinesManager
from configuration import *
from qualang_tools.callable_from_qua import *
from qualang_tools.loops import from_array
Expand Down
2 changes: 1 addition & 1 deletion qualang_tools/addons/calibration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Several options are also available for customizing the plots. All of them are wr


```python
from qm.QuantumMachinesManager import QuantumMachinesManager
from qm import QuantumMachinesManager
from qualang_tools.addons.calibration.calibrations import *
from configuration import *

Expand Down
4 changes: 2 additions & 2 deletions qualang_tools/addons/calibration/calibrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"""

from qm.qua import *
from qm.QuantumMachinesManager import QuantumMachinesManager
from qm.QuantumMachine import QuantumMachine
from qm import QuantumMachinesManager
from qm import QuantumMachine
from qualang_tools.plot import interrupt_on_close
from qualang_tools.results import progress_counter, fetching_tool
from qualang_tools.units import unit
Expand Down
4 changes: 2 additions & 2 deletions qualang_tools/callable_from_qua/_callable_from_qua.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from time import sleep
from typing import List, Any, Dict
from functools import wraps
from qm.QmJob import QmJob
from qm import QmJob
from qm.program import Program
from qm.qua import declare_stream, save, pause
from qm.exceptions import QmQuaException
from qm.QuantumMachine import QuantumMachine
from qm import QuantumMachine
from qm.qua._dsl import _ResultSource, _Variable, align, _get_root_program_scope

__all__ = ["ProgramAddon", "callable_from_qua"]
Expand Down
2 changes: 1 addition & 1 deletion qualang_tools/callable_from_qua/_qua_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from qm.program import Program
from qm.qua._dsl import _ProgramScope as _ProgramScope_qua
from qm.QuantumMachine import QuantumMachine
from qm import QuantumMachine
from qm.simulate.interface import SimulationConfig


Expand Down
4 changes: 2 additions & 2 deletions qualang_tools/control_panel/manual_output_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import numpy as np
from qm import QuantumMachine
from qm.QmJob import QmJob
from qm.QuantumMachinesManager import QuantumMachinesManager
from qm import QmJob
from qm import QuantumMachinesManager
from qm.qua import *


Expand Down
2 changes: 1 addition & 1 deletion qualang_tools/control_panel/vna.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""calling function libraries"""

from qm.qua import *
from qm.QuantumMachinesManager import QuantumMachinesManager
from qm import QuantumMachinesManager
import numpy as np
import matplotlib.pyplot as plt

Expand Down
2 changes: 1 addition & 1 deletion qualang_tools/external_frameworks/qcodes/opx_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from qcodes.utils.validators import Numbers, Arrays
from qm import SimulationConfig, generate_qua_script
from qm.qua import program
from qm.QuantumMachinesManager import QuantumMachinesManager
from qm import QuantumMachinesManager
from qualang_tools.results import wait_until_job_is_paused
from qualang_tools.results import fetching_tool
from qualang_tools.plot import interrupt_on_close
Expand Down
4 changes: 2 additions & 2 deletions qualang_tools/multi_user/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ for another user.
Note: `host`, `config` and `prog` are assumed to be supplied by user.

```python
from qm.QuantumMachinesManager import QuantumMachinesManager
from qm.QmJob import QmJob
from qm import QuantumMachinesManager
from qm import QmJob
from qualang_tools.multi_user import qm_session
qmm = QuantumMachinesManager(host)

Expand Down
2 changes: 1 addition & 1 deletion qualang_tools/multi_user/multi_user_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from time import sleep

from qm import QuantumMachine
from qm.QuantumMachinesManager import QuantumMachinesManager
from qm import QuantumMachinesManager

msg = (
"A quantum machine cannot be opened because an existing quantum machine, using the same ports, is currently "
Expand Down
4 changes: 2 additions & 2 deletions qualang_tools/octave_tools/octave_tools.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import numpy as np
from qm.octave.calibration_db import CalibrationDB
from typing import Union
from qm.QmJob import QmJob
from qm import QmJob
from qm.jobs.running_qm_job import RunningQmJob
from qm.QuantumMachine import QuantumMachine
from qm import QuantumMachine
from qm.octave.octave_mixer_calibration import AutoCalibrationParams


Expand Down
6 changes: 3 additions & 3 deletions qualang_tools/plot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This function allows to interrupt the execution and free the console when closin
### Usage example

```python
from qm.QuantumMachinesManager import QuantumMachinesManager
from qm import QuantumMachinesManager
from qualang_tools.plot import interrupt_on_close
from qm.qua import *
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -56,7 +56,7 @@ This function gets the samples generated from the QUA simulator by element.
### Usage example

```python
from qm.QuantumMachinesManager import QuantumMachinesManager
from qm import QuantumMachinesManager
from qm import SimulationConfig
from qm.qua import *
from configuration import config
Expand All @@ -80,7 +80,7 @@ This function plots the samples generated from the QUA simulator by element usin
### Usage example

```python
from qm.QuantumMachinesManager import QuantumMachinesManager
from qm import QuantumMachinesManager
from qm import SimulationConfig
from qm.qua import *
from configuration import config
Expand Down
2 changes: 1 addition & 1 deletion qualang_tools/plot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from scipy import signal
import plotly.graph_objects as go
from matplotlib import pyplot as plt
from qm.QmJob import QmJob
from qm import QmJob
from qualang_tools.plot.fitting import *


Expand Down
2 changes: 1 addition & 1 deletion tests_against_server/test_bakery_server.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import matplotlib.pyplot as plt
import pytest
from qm.qua import *
from qm.QuantumMachinesManager import QuantumMachinesManager
from qm import QuantumMachinesManager
from qm import SimulationConfig
import numpy as np
from qualang_tools.bakery.bakery import baking
Expand Down
2 changes: 1 addition & 1 deletion tests_against_server/test_loops.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
from qualang_tools.loops import *
from qm.qua import *
from qm.QuantumMachinesManager import QuantumMachinesManager
from qm import QuantumMachinesManager
from copy import deepcopy
import numpy as np

Expand Down
4 changes: 2 additions & 2 deletions tests_against_server/test_multi_user.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
import numpy as np
from qm.QuantumMachinesManager import QuantumMachinesManager
from qm.QmJob import QmJob
from qm import QuantumMachinesManager
from qm import QmJob
from qm.qua import *
from qualang_tools.multi_user import qm_session

Expand Down

0 comments on commit 2c07e63

Please sign in to comment.