Skip to content

Commit

Permalink
[FEATURE] emu fresnel access in SDK (#136)
Browse files Browse the repository at this point in the history
* emu fresnel access in SDK

* changelog, version number

---------

Co-authored-by: oliver.gordon <oliver.gordon@pasqal.com>
  • Loading branch information
oliver-gordon and oliver.gordon authored Sep 11, 2024
1 parent 1ee3c87 commit d188930
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## [0.12.1] - 2024-09-11

- Introduce EMU_FRESNEL device type

## [0.12.0] - 2024-09-03

### Breaking change
Expand Down
2 changes: 1 addition & 1 deletion pasqal_cloud/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.


__version__ = "0.12.0"
__version__ = "0.12.1"
8 changes: 7 additions & 1 deletion pasqal_cloud/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@

from pasqal_cloud.client import Client
from pasqal_cloud.device import EmulatorType
from pasqal_cloud.device.configuration import BaseConfig, EmuFreeConfig, EmuTNConfig
from pasqal_cloud.device.configuration import (
BaseConfig,
EmuFreeConfig,
EmuTNConfig,
)
from pasqal_cloud.errors import (
BatchCancellingError,
BatchClosingError,
Expand Down Expand Up @@ -133,6 +137,8 @@ def _load_configuration(
conf_class = EmuTNConfig
elif info.data["device_type"] == EmulatorType.EMU_FREE.value:
conf_class = EmuFreeConfig
elif info.data["device_type"] == EmulatorType.EMU_FRESNEL.value:
return None
return conf_class.from_dict(configuration)

def add_jobs(
Expand Down
2 changes: 2 additions & 0 deletions pasqal_cloud/device/configuration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
InvalidConfiguration,
)
from pasqal_cloud.device.configuration.emu_free import EmuFreeConfig
from pasqal_cloud.device.configuration.emu_fresnel import EmuFresnelConfig
from pasqal_cloud.device.configuration.emu_tn import EmuTNConfig

__all__ = [
"BaseConfig",
"EmuFreeConfig",
"EmuFresnelConfig",
"EmuTNConfig",
"InvalidConfiguration",
]
8 changes: 8 additions & 0 deletions pasqal_cloud/device/configuration/emu_fresnel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from __future__ import annotations

from dataclasses import dataclass


@dataclass
class EmuFresnelConfig:
"""Configuration for the EMU_FRESNEL device type."""
1 change: 1 addition & 0 deletions pasqal_cloud/device/emulator_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
class EmulatorType(StrEnum):
EMU_FREE = "EMU_FREE"
EMU_TN = "EMU_TN"
EMU_FRESNEL = "EMU_FRESNEL"
1 change: 1 addition & 0 deletions tests/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ def test_cancel_batch_sdk_error(
EmuFreeConfig(),
EmuFreeConfig(extra_config={"dt": 10.0, "precision": "normal"}),
),
(EmulatorType.EMU_FRESNEL, None, None),
(
"SomethingElse",
BaseConfig(),
Expand Down

0 comments on commit d188930

Please sign in to comment.