Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions documentation/source/general/changelog/changelog-dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ Improvements
``qm.inpl_mult(X, inverse)``
(`PR #918 <https://github.com/eclipse-qrisp/Qrisp/pull/918>`_).

- Refactored the remaining methods of :ref:`QuantumVariable <QuantumVariable>`, adding type
hints and removing the process-wide registry of live variables (``QuantumVariable.live_qvs``),
along with ``QuantumVariable.__del__``. The ``auto_uncompute`` decorator now recognizes the
variables a function created by their creation time, and generated fallback names come from a
counter alone. Name collisions are still resolved per QuantumSession and when sessions are merged
(`PR #989 <https://github.com/eclipse-qrisp/Qrisp/pull/989>`_).

- Fewer qubits for :func:`reflection <qrisp.reflection>`:
:func:`reflection <qrisp.reflection>` no longer bundles its operations into a
single gate. The bundling kept every ancilla of the ``state_function`` allocated
Expand All @@ -176,6 +183,12 @@ Improvements
operations instead of a single ``reflection`` gate. Jasp mode is unaffected
(`PR #947 <https://github.com/eclipse-qrisp/Qrisp/pull/947>`_).

- Refactored some methods of :ref:`QuantumVariable <QuantumVariable>`, adding type
hints and simplifying the bookkeeping of live variables. ``QuantumVariable.live_qvs`` no longer
has to be swept for dead weak references on every deletion, and ``QuantumVariable.__del__`` has
been removed
(`PR #989 <https://github.com/eclipse-qrisp/Qrisp/pull/989>`_).

Other New Features
------------------

Expand Down Expand Up @@ -735,11 +748,23 @@ API Changes
``QuantumVariable.creation_counter`` instead
(`PR #882 <https://github.com/eclipse-qrisp/Qrisp/pull/882>`_).

* ``QuantumVariable.live_qvs`` has been removed, and ``QuantumVariable.name_tracker`` is
now a ``collections.Counter``. Code that looked up QuantumVariables through ``live_qvs``
must keep its own references, or use the ``qv_list`` of the relevant QuantumSession
(`PR #989 <https://github.com/eclipse-qrisp/Qrisp/pull/989>`_).

.. Add API changes above this line

Development
-----------

* Removed the ``None`` check from ``QuantumVariable.__setitem__``. It was written as
``isinstance(type(value), type(None))``, which is never true, so the early return for
``qv[:] = None`` was never executed. It was removed deliberately instead of fixed, because
``None`` can be a valid label, e.g. for ``QuantumVariable.custom([None, ...])``, so
``qv[:] = None`` keeps being passed on to the encoder
(`PR #989 <https://github.com/eclipse-qrisp/Qrisp/pull/989>`_).

* Added ``jaspr_to_static_register_jaspr``, which rewrites a Jaspr so that all
qubits come from a single register of fixed size allocated at program start.
The CUDA-Q backend in `qrisp-cudaq <https://github.com/eclipse-qrisp/qrisp-cudaq>`_
Expand Down
2 changes: 1 addition & 1 deletion src/qrisp/core/compilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def qompiler(
compile_mcm=False,
gate_speed=None,
use_dirty_anc_for_mcx_recomp=True,
):
) -> QuantumCircuit:
if len(qs.data) == 0:
return QuantumCircuit(0)

Expand Down
1 change: 0 additions & 1 deletion src/qrisp/core/quantum_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ def register_qv(self, qv: QuantumVariable, size: int | None = None):
# Register in the list of active quantum variable
self.qv_list.append(qv)

QuantumVariable.live_qvs.append(weakref.ref(qv))
qv.creation_time = QuantumVariable.creation_counter
QuantumVariable.creation_counter += 1

Expand Down
Loading
Loading