-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate determinant addresses as input to fermionic solver functions (
#29) * Fermionic solver functions should take the bitstring matrix as input, same as qubit solver * Add `addresses` as kwarg (#31) * Small tutorial fix * Update docstring * Remove addresses as kwarg * Clean up docstrings --------- Co-authored-by: Jim Garrison <[email protected]>
- Loading branch information
1 parent
256e5e1
commit c115ea2
Showing
6 changed files
with
129 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
deprecations: | ||
- | | ||
The ``addressess`` argument to :func:`qiskit_addon_sqd.fermion.solve_fermion` and :func:`qiskit_addon_sqd.fermion.optimize_orbitals` has been deprecated in favor of ``bitstring_matrix``. Users are no longer required to convert their configurations to base-10 determinants; instead, they should now pass in the bitstring matrix specifying the subspace onto which to project and diagonalize the Hamiltonian. The conversion to determinant addresses will be done internally. | ||
upgrade: | ||
- | | ||
Specifying ``addresses`` as a keyword argument to :func:`qiskit_addon_sqd.fermion.solve_fermion` and :func:`qiskit_addon_sqd.fermion.optimize_orbitals` is no longer supported. Users may still pass ``addresses`` as the first positional argument; however, this usage is deprecated. Users are encouraged to pass the bitstring matrix defining the subspace as the first positional arguments to these functions, as shown below. | ||
To upgrade, change this code | ||
.. code-block:: python | ||
from qiskit_addon_sqd.fermion import bitstring_matrix_to_sorted_addresses | ||
from qiskit_addon_sqd.fermion import solve_fermion, optimize_orbitals | ||
bitstring_matrix = ... | ||
addresses = bitstring_matrix_to_sorted_addresses(bitstring_matrix, open_shell=open_shell) | ||
energy, coeffs, occs, spin = solve_fermion( | ||
addresses=addresses, | ||
hcore=hcore, | ||
eri=eri, | ||
) | ||
... | ||
e_oo, rotation, occs_oo = optimize_orbitals( | ||
addresses=addresses, | ||
hcore=hcore, | ||
eri=eri, | ||
) | ||
...to this code | ||
.. code-block:: python | ||
from qiskit_addon_sqd.fermion import solve_fermion, optimize_orbitals | ||
bitstring_matrix = ... | ||
energy, coeffs, occs, spin = solve_fermion( | ||
bitstring_matrix, | ||
hcore=hcore, | ||
eri=eri, | ||
) | ||
... | ||
e_oo, rotation, occs_oo = optimize_orbitals( | ||
bitstring_matrix, | ||
hcore=hcore, | ||
eri=eri, | ||
) |