Skip to content

Commit

Permalink
add final_orbital_rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
bartandrews committed Nov 7, 2024
1 parent e997491 commit 0db2929
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
15 changes: 13 additions & 2 deletions docs/how-to-guides/lucj_mps.ipynb

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions python/ffsim/tenpy/circuits/lucj_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,9 @@ def lucj_circuit_as_mps(
apply_orbital_rotation(
ucj_op.orbital_rotations[i], psi, eng, chi_list, norm_tol
)
if ucj_op.final_orbital_rotation is not None:
apply_orbital_rotation(
ucj_op.final_orbital_rotation, psi, eng, chi_list, norm_tol
)

return psi, chi_list
2 changes: 1 addition & 1 deletion python/ffsim/tenpy/hamiltonians/molecular_hamiltonian.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def from_molecular_hamiltonian(
Rounding may reduce the MPO bond dimension.
Returns:
The molecular Hamiltonian as a TeNPy MPOModel.
The molecular Hamiltonian as a `TeNPy MPOModel <https://tenpy.readthedocs.io/en/stable/reference/tenpy.models.model.MPOModel.html#tenpy.models.model.MPOModel>`__.
"""

if decimal_places:
Expand Down
4 changes: 2 additions & 2 deletions tests/python/tenpy/lucj_circuit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_lucj_circuit_as_mps(norb: int, nelec: tuple[int, int], connectivity: st
interaction_pairs=_interaction_pairs_spin_balanced_(
connectivity=connectivity, norb=norb
),
with_final_orbital_rotation=False,
with_final_orbital_rotation=True,
)
params = rng.uniform(-10, 10, size=n_params)
lucj_op = ffsim.UCJOpSpinBalanced.from_parameters(
Expand All @@ -85,7 +85,7 @@ def test_lucj_circuit_as_mps(norb: int, nelec: tuple[int, int], connectivity: st
interaction_pairs=_interaction_pairs_spin_balanced_(
connectivity=connectivity, norb=norb
),
with_final_orbital_rotation=False,
with_final_orbital_rotation=True,
)

# generate the corresponding LUCJ circuit
Expand Down

0 comments on commit 0db2929

Please sign in to comment.