From 2b2929c583a609930e61c282609d55500a085225 Mon Sep 17 00:00:00 2001 From: QFer Date: Tue, 10 May 2022 16:48:31 +0200 Subject: [PATCH 1/2] [SDS-610] Deleted measurement mask field (description) from asset --- src/quantuminspire/api.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/quantuminspire/api.py b/src/quantuminspire/api.py index aa93219..4290ee4 100644 --- a/src/quantuminspire/api.py +++ b/src/quantuminspire/api.py @@ -787,8 +787,6 @@ def get_asset(self, asset_id: int) -> Dict[str, Any]: 'text/plain'. ``content`` str The content itself. For example a cQASM program when linked to a job. - ``measurement_mask`` list(list) For each measurement block a list of 0/1 (not measured/measured) for - all the qubits in the cQASM program. ``project`` str Url to get the project properties for which this asset was created. ``project_id`` int The project id of the project for which this asset was created. From db8792297467eb43ccdeebe4cb0f985ed3d78410 Mon Sep 17 00:00:00 2001 From: QFer Date: Tue, 10 May 2022 16:59:38 +0200 Subject: [PATCH 2/2] boyscouting from last release and an earlier review comment --- setup.py | 2 ++ src/quantuminspire/projectq/backend_qx.py | 41 ++++++++++++----------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/setup.py b/setup.py index 9a4f4cb..afbfb09 100644 --- a/setup.py +++ b/setup.py @@ -43,8 +43,10 @@ def get_long_description(): description='SDK for the Quantum Inspire platform', long_description=get_long_description(), long_description_content_type='text/markdown', + url='https://qutech.nl', version=get_version_number('quantuminspire'), author='QuantumInspire', + author_email='support@quantum-inspire.com', python_requires='>=3.7', package_dir={'': 'src'}, classifiers=[ diff --git a/src/quantuminspire/projectq/backend_qx.py b/src/quantuminspire/projectq/backend_qx.py index c992c7d..6421fab 100644 --- a/src/quantuminspire/projectq/backend_qx.py +++ b/src/quantuminspire/projectq/backend_qx.py @@ -336,16 +336,16 @@ def _logical_to_physical(self, logical_qubit_id: int) -> int: :return: Physical position of logical qubit with id qb_id. """ - if self.main_engine.mapper is not None: - mapping = self.main_engine.mapper.current_mapping - if logical_qubit_id not in mapping: - raise RuntimeError(f"Unknown qubit id {logical_qubit_id}. Please make sure " - f"eng.flush() was called and that the qubit " - f"was not eliminated during optimization.") + if self.main_engine.mapper is None: + return logical_qubit_id # no mapping - return int(mapping[logical_qubit_id]) + mapping = self.main_engine.mapper.current_mapping + if logical_qubit_id not in mapping: + raise RuntimeError(f"Unknown qubit id {logical_qubit_id}. Please make sure " + f"eng.flush() was called and that the qubit " + f"was not eliminated during optimization.") - return logical_qubit_id # no mapping + return int(mapping[logical_qubit_id]) def _physical_to_simulated(self, physical_qubit_id: int) -> int: """ @@ -395,18 +395,19 @@ def _physical_to_logical(self, physical_qubit_id: int) -> int: :return: Logical bit position of physical qubit. """ - if self.main_engine.mapper is not None: - mapping = self.main_engine.mapper.current_mapping - # current_mapping is a dictionary with keys being the - # logical qubit ids and the values being the physical ids - for logical_id, physical_id in mapping.items(): - if int(physical_id) == physical_qubit_id: - return int(logical_id) - - raise RuntimeError(f"Unknown physical qubit id {physical_qubit_id}. Please make sure " - f"eng.flush() was called and that the qubit " - f"was not eliminated during optimization.") - return physical_qubit_id # no mapping + if self.main_engine.mapper is None: + return physical_qubit_id # no mapping + + mapping = self.main_engine.mapper.current_mapping + # current_mapping is a dictionary with keys being the + # logical qubit ids and the values being the physical ids + for logical_id, physical_id in mapping.items(): + if int(physical_id) == physical_qubit_id: + return int(logical_id) + + raise RuntimeError(f"Unknown physical qubit id {physical_qubit_id}. Please make sure " + f"eng.flush() was called and that the qubit " + f"was not eliminated during optimization.") def _add_delayed_measurements(self) -> None: """ Add the recorded measurements to the qasm algorithm.