diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d323b97b8..54968f4b0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,11 @@ Changelog ========= +Version 20.4 +============ +* ``active_reset_cycles`` added to ``CircuitCompilationOptions`` (in 20.2 it was only added to ``RunRequest`` making it + difficult to use). + Version 20.3 ============ diff --git a/src/iqm/iqm_client/iqm_client.py b/src/iqm/iqm_client/iqm_client.py index 2acf79af3..ed7b5f3a9 100644 --- a/src/iqm/iqm_client/iqm_client.py +++ b/src/iqm/iqm_client/iqm_client.py @@ -241,7 +241,6 @@ def create_run_request( self._validate_circuit_instructions( architecture, circuits, qubit_mapping, validate_moves=options.move_gate_validation ) - return RunRequest( qubit_mapping=serialized_qubit_mapping, circuits=circuits, @@ -252,6 +251,7 @@ def create_run_request( heralding_mode=options.heralding_mode, move_validation_mode=options.move_gate_validation, move_gate_frame_tracking_mode=options.move_gate_frame_tracking, + active_reset_cycles=options.active_reset_cycles, ) def submit_run_request(self, run_request: RunRequest) -> UUID: diff --git a/src/iqm/iqm_client/models.py b/src/iqm/iqm_client/models.py index 3a6e8f96e..c74b46e1d 100644 --- a/src/iqm/iqm_client/models.py +++ b/src/iqm/iqm_client/models.py @@ -656,6 +656,11 @@ class CircuitCompilationOptions: move_gate_frame_tracking: MoveGateFrameTrackingMode = MoveGateFrameTrackingMode.FULL """MOVE gate frame tracking mode for circuit compilation. This options is ignored on devices that do not support MOVE and for circuits that do not contain MOVE gates.""" + active_reset_cycles: Optional[int] = None + """Number of active ``reset`` operations inserted at the beginning of each circuit for each active qubit. + ``None`` means active reset is not used but instead reset is done by waiting (relaxation). Integer values smaller + than 1 result in neither active nor reset by wait being used, in which case any reset operations must be explicitly + added in the circuit.""" def __post_init__(self): """Validate the options.""" diff --git a/tests/test_iqm_client.py b/tests/test_iqm_client.py index d7ebedce1..d63973024 100644 --- a/tests/test_iqm_client.py +++ b/tests/test_iqm_client.py @@ -831,7 +831,7 @@ def test_abort_job_failed(status_code, sample_client, existing_job_url, existing 'params', [ {}, - {'options': CircuitCompilationOptions(heralding_mode=HeraldingMode.ZEROS)}, + {'options': CircuitCompilationOptions(heralding_mode=HeraldingMode.ZEROS, active_reset_cycles=1)}, {'custom_settings': {'some_setting': 1}}, {'calibration_set_id': uuid.uuid4()}, {'options': CircuitCompilationOptions(max_circuit_duration_over_t2=0.0)}, @@ -859,7 +859,8 @@ def test_create_and_submit_run_request( when(requests).get(dynamic_architecture_url, ...).thenReturn(dynamic_architecture_success) run_request = sample_client.create_run_request([sample_circuit], **params) - + if 'options' in params: + assert run_request.active_reset_cycles == params['options'].active_reset_cycles expect(requests, times=2).post(jobs_url, **post_jobs_args(run_request)).thenReturn(submit_success) assert sample_client.submit_run_request(run_request) == existing_run_id assert sample_client.submit_circuits([sample_circuit], **params) == existing_run_id