Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1bef350
initial implementation of sparse isometry
RushiGong Apr 2, 2026
4b0bd86
Merge branch main into feature/rsg/binary_encoding
RushiGong Apr 3, 2026
3102e9b
add test for binary encoding
RushiGong Apr 3, 2026
8db8cdd
add notebook
RushiGong Apr 6, 2026
a93946f
remove redundant demo notebook
RushiGong Apr 6, 2026
8a87f8b
remove redundant qsharp init
RushiGong Apr 6, 2026
eab38f0
fix qdk interpreter test
RushiGong Apr 7, 2026
12f40e3
merge staircase functionalities
RushiGong Apr 7, 2026
0219eca
fix doc build
RushiGong Apr 7, 2026
7b68672
fix comments
RushiGong Apr 7, 2026
20dbc5e
Merge branch 'main' into feature/rsg/binary_encoding
RushiGong Apr 9, 2026
82bff65
fix StrEnum
RushiGong Apr 9, 2026
8c10b63
static not compatible with prune qubits
RushiGong Apr 9, 2026
1bfe509
apply AI code review comments
RushiGong Apr 10, 2026
3c1764e
use ancilla from idle qubit pools
RushiGong Apr 23, 2026
603ab36
Merge branch 'main' into feature/rsg/binary_encoding
RushiGong Apr 23, 2026
1482d91
remove unused ancilla pool comments
RushiGong Apr 23, 2026
8589163
add methods to create dense and sparse isometry circuit separately
YingrongChen Apr 24, 2026
c0eb7c2
fix pre-commit
YingrongChen Apr 25, 2026
2c0a467
fix pre-commit
YingrongChen Apr 25, 2026
6626f09
improve binary encoding cost
YingrongChen Apr 25, 2026
54866ea
fix test_utils_binary_encoding
YingrongChen Apr 27, 2026
32c98e4
Merge branch 'main' into feature/rsg/binary_encoding
RushiGong Apr 28, 2026
ac9b40c
fallback to prepare from gf2x matrix if already dense
RushiGong Apr 28, 2026
8bd861f
merge main
RushiGong May 21, 2026
3236346
rename gf2x sparse isometry
RushiGong May 21, 2026
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
2 changes: 1 addition & 1 deletion docs/source/_static/examples/python/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
_, wfn_cas = create("multi_configuration_calculator").run(ham, 1, 1)

# StatePreparation produces a Circuit with a native Q# factory
state_prep = create("state_prep", "sparse_isometry_gf2x")
state_prep = create("state_prep", "sparse_isometry")
circuit = state_prep.run(wfn_cas)

# Inspect the Q# circuit (prune unused qubits for clarity)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/_static/examples/python/phase_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
qubit_ham = qubit_mapper.run(hamiltonian)

# 6. State preparation
state_prep = create("state_prep", "sparse_isometry_gf2x")
state_prep = create("state_prep", "sparse_isometry")
circuit = state_prep.run(wfn_cas)

# 7. Create and run IQPE with nested algorithm settings
Expand Down
2 changes: 1 addition & 1 deletion docs/source/_static/examples/python/quickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
# start-state-prep-circuit

# Generate state preparation circuit for the sparse state via sparse isometry (GF2 + X)
state_prep = create("state_prep", "sparse_isometry_gf2x")
state_prep = create("state_prep", "sparse_isometry")
sparse_isometry_circuit = state_prep.run(wfn_sparse)

# end-state-prep-circuit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
_cas = create("multi_configuration_calculator", "macis_cas")
_E_cas, _wfn_cas = _cas.run(_hamiltonian, 1, 1)

_state_prep = create("state_prep", "sparse_isometry_gf2x")
_state_prep = create("state_prep", "sparse_isometry")
_circuit = _state_prep.run(_wfn_cas)

circuit_executor = create("circuit_executor", "qdk_sparse_state_simulator")
Expand Down
4 changes: 2 additions & 2 deletions docs/source/_static/examples/python/state_preparation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from qdk_chemistry.algorithms import create

# Create a StatePreparation instance
sparse_prep = create("state_prep", "sparse_isometry_gf2x")
sparse_prep = create("state_prep", "sparse_isometry")
regular_prep = create("state_prep", "qiskit_regular_isometry")
# end-cell-create
################################################################################
Expand Down Expand Up @@ -61,6 +61,6 @@
from qdk_chemistry.algorithms import registry

print(registry.available("state_prep"))
# ['sparse_isometry_gf2x', 'qiskit_regular_isometry']
# ['sparse_isometry', 'qiskit_regular_isometry']
# end-cell-list-implementations
################################################################################
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@
"sphinx.ext.autosummary", # Create summary tables for modules/classes
"sphinx.ext.intersphinx", # Link to other projects' documentation
"sphinx.ext.viewcode", # Add links to view source code
"sphinx.ext.napoleon", # Support for Google-style and NumPy-style docstrings
# Additional extensions
"sphinx_autodoc_typehints", # Better support for Python type annotations
"sphinx_inline_tabs", # Support for tabbed content in docs
# C++ documentation
"breathe", # Bridge between Sphinx and Doxygen
# Enable Google-style docstrings parsing
"sphinx.ext.napoleon", # Support for Google-style and NumPy-style docstrings
"sphinx.ext.todo", # Support for listing to-dos
"sphinx.ext.graphviz", # Support for Graphviz diagrams
"sphinxcontrib.bibtex", # Support for bibliographic references
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ You can discover available implementations programmatically:
Sparse Isometry GF2+X
~~~~~~~~~~~~~~~~~~~~~

.. rubric:: Factory name: ``"sparse_isometry_gf2x"``
.. rubric:: Factory name: ``"sparse_isometry"``

This method is an optimized approach that leverages sparsity in the target wavefunction. The GF2+X method, a modification of the original sparse isometry work in :cite:`Malvetti2021`, applies GF(2) Gaussian elimination to the binary matrix representation of the state to determine a reduced space representation of the sparse state. This reduced state is then densely encoded via regular isometry :cite:`Christandl2016` on a smaller number of qubits, and finally scattered to the full qubit space using X and :term:`CNOT` gates. These reductions correspond to efficient gate sequences that simplify the preparation basis. By focusing only on non-zero amplitudes, this approach substantially reduces circuit depth and gate count compared with dense isometry methods. This method is native to QDK/Chemistry and is especially efficient for wavefunctions with sparse amplitude structure.

Expand Down
2 changes: 1 addition & 1 deletion examples/extended_hubbard.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@
"from qdk.widgets import Circuit\n",
"\n",
"# Generate state preparation circuit for the sparse state via GF2+X sparse isometry\n",
"state_prep = create(\"state_prep\", \"sparse_isometry_gf2x\")\n",
"state_prep = create(\"state_prep\", \"sparse_isometry\")\n",
"state_prep_circuit = state_prep.run(wfn_trial)\n",
"\n",
"# Visualize the sparse isometry circuit\n",
Expand Down
8 changes: 4 additions & 4 deletions examples/factory_list.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1134,28 +1134,28 @@
"</tr>\n",
"<tr>\n",
"<td>state_prep</td>\n",
"<td>sparse_isometry_gf2x</td>\n",
"<td>sparse_isometry</td>\n",
"<td>State preparation using sparse isometry with enhanced GF2+X elimination.</td>\n",
"<td>basis_gates</td>\n",
"<td>[&#x27;x&#x27;, &#x27;y&#x27;, &#x27;z&#x27;, &#x27;cx&#x27;, &#x27;cz&#x27;, &#x27;id&#x27;, &#x27;h&#x27;, &#x27;s&#x27;, &#x27;sdg&#x27;, &#x27;rz&#x27;]</td>\n",
"</tr>\n",
"<tr>\n",
"<td>state_prep</td>\n",
"<td>sparse_isometry_gf2x</td>\n",
"<td>sparse_isometry</td>\n",
"<td>State preparation using sparse isometry with enhanced GF2+X elimination.</td>\n",
"<td>dense_preparation_method</td>\n",
"<td>qdk</td>\n",
"</tr>\n",
"<tr>\n",
"<td>state_prep</td>\n",
"<td>sparse_isometry_gf2x</td>\n",
"<td>sparse_isometry</td>\n",
"<td>State preparation using sparse isometry with enhanced GF2+X elimination.</td>\n",
"<td>transpile</td>\n",
"<td>True</td>\n",
"</tr>\n",
"<tr>\n",
"<td>state_prep</td>\n",
"<td>sparse_isometry_gf2x</td>\n",
"<td>sparse_isometry</td>\n",
"<td>State preparation using sparse isometry with enhanced GF2+X elimination.</td>\n",
"<td>transpile_optimization_level</td>\n",
"<td>0</td>\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/interoperability/qiskit/iqpe_no_trotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def run_iterative_exact_qpe(
active_hamiltonian, list(top_configurations.keys())
)

sparse_state_prep = create("state_prep", algorithm_name="sparse_isometry_gf2x")
sparse_state_prep = create("state_prep", algorithm_name="sparse_isometry")
state_prep = sparse_state_prep.run(sparse_wavefunction).get_qiskit_circuit()
state_prep = transpile(
state_prep,
Expand Down
2 changes: 1 addition & 1 deletion examples/interoperability/qiskit/iqpe_trotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
active_hamiltonian, list(top_configurations.keys())
)

sparse_state_prep = create("state_prep", algorithm_name="sparse_isometry_gf2x")
sparse_state_prep = create("state_prep", algorithm_name="sparse_isometry")
state_prep = sparse_state_prep.run(sparse_wavefunction).get_qiskit_circuit()
state_prep = transpile(
state_prep,
Expand Down
2 changes: 1 addition & 1 deletion examples/qpe_stretched_n2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@
"from qdk.widgets import Circuit\n",
"\n",
"# Generate state preparation circuit for the sparse state via GF2+X sparse isometry\n",
"state_prep = create(\"state_prep\", \"sparse_isometry_gf2x\")\n",
"state_prep = create(\"state_prep\", \"sparse_isometry\")\n",
"sparse_isometry_circuit = state_prep.run(wfn_trial)\n",
"\n",
"# Visualize the sparse isometry circuit, idle and classical qubits are removed\n",
Expand Down
Loading
Loading