From 32696b42b042e877bfcdb22592e1b24ba70d6e44 Mon Sep 17 00:00:00 2001 From: PabloAndresCQ Date: Thu, 26 Sep 2024 11:57:06 +0100 Subject: [PATCH 1/3] Fixed docs missing get_bits, and fixes to changelog --- docs/changelog.rst | 4 ++-- docs/modules/structured_state.rst | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 61c44d28..3936ba3f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -10,10 +10,10 @@ Unreleased * New feature: ``simulate`` now accepts pytket circuits with ``Measure``, ``Reset``, ``Conditional``, ``ClassicalExpBox`` and more classical operations. You can now retrieve classical bit values using ``get_bits``. * When calling ``simulate``, the gates on the circuit are no longer sorted by default. Use ``compilation_params["sort_gates"] = True`` to recover this behaviour, which is now deprecated. * ``StructuredState`` now supports simulation of single qubit circuits. -* Some bugfixes on MPSxMPO relating to measurement and relabelling qubits. The bug was caused due to these functions not guaranteeing the MPO was applied before their action. +* Some bugfixes on ``MPSxMPO`` relating to measurement and relabelling qubits. The bug was caused due to these functions not guaranteeing the MPO was applied before their action. * Documentation fixes: * ``apply_qubit_relabelling`` now appears in the documentation. - * ``add_qubit`` removed from documentation of MPSxMPO, since it is not supported. + * ``add_qubit`` removed from documentation of ``MPSxMPO``, since it is not currently supported. 0.7.1 (July 2024) ----------------- diff --git a/docs/modules/structured_state.rst b/docs/modules/structured_state.rst index 8fd0506a..94cb320f 100644 --- a/docs/modules/structured_state.rst +++ b/docs/modules/structured_state.rst @@ -35,6 +35,7 @@ Classes .. automethod:: get_fidelity .. automethod:: get_statevector .. automethod:: get_amplitude + .. automethod:: get_bits .. automethod:: get_qubits .. automethod:: get_byte_size .. automethod:: get_device_id From cc3afe8b16bc91a0c7a387d60155daf72ca40642 Mon Sep 17 00:00:00 2001 From: PabloAndresCQ Date: Thu, 26 Sep 2024 12:02:51 +0100 Subject: [PATCH 2/3] Updated version number --- _metadata.py | 2 +- docs/changelog.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/_metadata.py b/_metadata.py index 5d0b2ac5..f793cf1c 100644 --- a/_metadata.py +++ b/_metadata.py @@ -1,2 +1,2 @@ -__extension_version__ = "0.7.1" +__extension_version__ = "0.8.0" __extension_name__ = "pytket-cutensornet" diff --git a/docs/changelog.rst b/docs/changelog.rst index 3936ba3f..390be13a 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,8 +1,8 @@ Changelog ~~~~~~~~~ -Unreleased ----------- +0.8.0 (September 2024) +---------------------- * API breaking changes * Removed ``use_kahypar`` option from ``Config``. It can still be set via the ``simulate`` option ``compilation_params``. From 94ce2dcddb7e7ad8a76841b9c8acef1d7ef40464 Mon Sep 17 00:00:00 2001 From: PabloAndresCQ Date: Thu, 26 Sep 2024 13:41:19 +0100 Subject: [PATCH 3/3] Added clarification to get_bits docstring --- pytket/extensions/cutensornet/structured_state/general.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pytket/extensions/cutensornet/structured_state/general.py b/pytket/extensions/cutensornet/structured_state/general.py index c6d4276b..0cc56230 100644 --- a/pytket/extensions/cutensornet/structured_state/general.py +++ b/pytket/extensions/cutensornet/structured_state/general.py @@ -448,7 +448,10 @@ def get_amplitude(self, state: int) -> complex: raise NotImplementedError(f"Method not implemented in {type(self).__name__}.") def get_bits(self) -> dict[Bit, bool]: - """Returns the dictionary of bits and their values.""" + """Returns the dictionary of bits and their values. + + A bit with value ``False`` corresponds to ``0``, and ``True`` is ``1``. + """ return self._bits_dict.copy() @abstractmethod