Skip to content

Commit

Permalink
Add notes to project_operator docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb-johnson committed Oct 3, 2024
1 parent 5fa4e0c commit 9f5c58c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions qiskit_addon_sqd/qubit.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@ def project_operator_to_subspace(
The subspace is defined by a collection of computational basis states, which are specified by the bitstrings
(rows) in ``bitstring_matrix``.
.. note::
The bitstrings in the ``bitstring_matrix`` must be unique and sorted in ascending order
according to their unsigned integer representation. Otherwise the projection will return wrong
results. This function does not explicitly check for uniqueness and order because
this can be rather time consuming. See :func:`qiskit_addon_sqd.qubit.sort_and_remove_duplicates`
for a simple way to ensure your bitstring matrix is well-formatted.
.. note::
This function relies on ``jax`` to efficiently perform some calculations. ``jax``
converts the bit arrays to ``int64_t``, which means the bit arrays in
``bitstring_matrix`` may not have length greater than ``63``.
Args:
bitstring_matrix: A 2D array of ``bool`` representations of bit
values such that each row represents a single bitstring. This set of
Expand Down

0 comments on commit 9f5c58c

Please sign in to comment.