Add parameterized Qiskit LUCJ ansatz#669
Conversation
|
I’m going to keep this as a draft for now while I do a deeper local validation pass. In addition to the committed tests, I want to check a few things more exhaustively before marking this ready for review:
The main thing I want to be sure of is that the new parameterized circuit is not just structurally reasonable, but actually matches the existing ffsim/Qiskit LUCJ behavior across representative cases. Once that internal pass looks clean, I’ll move this out of draft. |
|
I did the extra local validation I wanted to do before marking this ready. Besides the tests in the PR, I ran randomized checks against the existing ffsim/Qiskit LUCJ path. That included full-state evolution, fixed particle-number sectors, restricted interaction pairs, and Everything matched to numerical precision. The generated parameterized circuits agreed with the existing merged UCJ circuit behavior up to global phase, including the restricted-interaction cases. Marking this ready for review now. |
Summary
This adds a native Qiskit parameterized implementation of the spin-balanced LUCJ ansatz.
I had an internal prototype for this path, and spent time converting it into a proper ffsim PR: public helpers, input validation, tests, and a docs example, rather than just adding the prototype directly.
The main entry point is
ffsim.qiskit.lucj_spin_balanced_ansatz, which builds the merged LUCJ circuit form used afterffsim.qiskit.PRE_INIT. The circuit exposes Qiskit parameters directly on the orbital-rotation and diagonal Coulomb gates, so it can be optimized in standard Qiskit workflows.Closes #411.
Details
ffsim.qiskit.lucj_spin_balanced_ansatz.lucj_spin_balanced_parametersfor initializing the parameterized circuit from an existing spin-balanced UCJ operator.lucj_spin_balanced_parameters_from_t2for initializing from CCSD amplitudes.interaction_pairs.t2initialization.Validation
Locally I ran:
ruff check python/ffsim/qiskit/__init__.py python/ffsim/qiskit/lucj.py tests/python/qiskit/lucj_test.pyruff format --check python/ffsim/qiskit/__init__.py python/ffsim/qiskit/lucj.py tests/python/qiskit/lucj_test.pyruff check docs/how-to-guides/qiskit-lucj.ipynbpytest tests/python/qiskit/lucj_test.pypytest tests/python/qiskit/gates/ucj_test.py tests/python/variational/ucj_spin_balanced_test.pypytest tests/python/qiskit