-
Notifications
You must be signed in to change notification settings - Fork 40
MPS emulator for LUCJ circuits #334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bartandrews
wants to merge
136
commits into
qiskit-community:main
Choose a base branch
from
bartandrews:mpo
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 21 commits
Commits
Show all changes
136 commits
Select commit
Hold shift + click to select a range
7bbd1b7
add to_mpo method to MolecularHamiltonian class
bartandrews b283f11
specify class name as MPOModel
bartandrews 15c5823
fix comment
bartandrews 5795e04
remove print statements
bartandrews acc9845
add docstrings for TeNPy classes
bartandrews 38078be
add lucj_circuit_as_mps function
bartandrews 7b8113b
update how-to notebook
bartandrews e0b26dc
clean-up code
bartandrews a96b5e3
fix docstrings
bartandrews c9a93be
fix docstring 2
bartandrews 0103d47
import annotations
bartandrews 28de05f
fix docstring 3
bartandrews c32dc85
fix molecular Hamiltonian MPO conversion
bartandrews 5afd692
fix type hint
bartandrews b84ac28
remove unused import
bartandrews 6049511
import ordering
bartandrews cc380c7
fix type hint import
bartandrews 56159ea
fix type hints in gates.py
bartandrews 3820e25
fix type hints in lucj_circuit.py
bartandrews 94b7d93
fix type hint for util.py
bartandrews 18078c9
fix another type hint in lucj_circuit.py
bartandrews b980c3b
add from_molecular_hamiltonian static method
bartandrews cd0f1ce
directly import UCJOpSpinBalanced for type hint
bartandrews ea4f56f
update notebook
bartandrews e608dc5
update notebook 2
bartandrews a975567
fix formatting
bartandrews 7af99aa
resolve conflict in __init__ file
bartandrews 13fd307
resolve conflicts
bartandrews 8eb2749
Merge branch 'main' into mpo
bartandrews fa52080
start transition from qubit to fermionic gate names
bartandrews 20c24ce
finish transition from qubit to fermionic gate names
bartandrews 6be63f1
minor change to NNgate
bartandrews e997491
apply UCJ operator directly
bartandrews 0db2929
add final_orbital_rotation
bartandrews 12263d5
remove decimal_places argument of from_molecular_hamiltonian
bartandrews b8f35fb
fix final_orbital_rotation bug
bartandrews 205b3c4
add zip loop in lucj_circuit
bartandrews f2b9e90
add keyword-only arguments
bartandrews e99a1fd
fix angles in orbital_rotation
bartandrews bdf583b
leverage current_basis in lucj_circuit_as_mps
bartandrews 18ae3f3
closed-form expressions for gates
bartandrews d25d18d
remove flag from __init__ in MolecularHamiltonianMPOModel
bartandrews e387940
delete __init__ method from MolecularHamiltonianMPOModel
bartandrews c931665
reduce numpy use
bartandrews b40e4e3
streamline sym_cons_basis
bartandrews 9fe8ed9
remove unnecesary phase factor in apply_orbital_rotation
bartandrews 994b651
get rid of conj argument for givens_rotation
bartandrews 43aa2b2
add test_apply_orbital_rotation
bartandrews e25a1d1
fix norb definition
bartandrews 1e6858e
remove MolecularChain class
bartandrews 9fbdfc9
tidy lucj_circuit_test
bartandrews b9cf3a1
refactor bitstring_to_mps
bartandrews f6c7fe6
Merge branch 'main' into mpo
bartandrews debce23
tidy MolecularHamiltonianMPOModel
bartandrews dc7d07f
simplify for loops
bartandrews 2e1777c
tidy product_state_as_mps utility function
bartandrews c7dcc6b
rename lucj_circuit_as_mps to apply_ucj_op_spin_balanced
bartandrews 3207948
fix notebook
bartandrews 1300a13
major gate refactoring
bartandrews cee4538
improve docstrings
bartandrews c4f305e
add more gate tests
bartandrews 0311020
fix notebook
bartandrews 0f84845
fix typo
bartandrews df7bab5
address review comments
bartandrews 697bbc7
add time argument to apply_diag_coulomb_evolution function
bartandrews 1f7c322
add random molecular Hamiltonian to all gate tests
bartandrews 3007015
start simplifying molecular Hamiltonian
bartandrews eb0fbc9
Merge branch 'qiskit-community:main' into mpo
bartandrews 8f0640c
simplify two_body_tensor loop in molecular Hamiltonian
bartandrews 62f9ec5
fix minor errors
bartandrews 7ed0f2c
further simplify two_body_tensor loop in molecular Hamiltonian
bartandrews 6efd6d7
refactor molecular hamiltonian
bartandrews e2ab247
expand molecular Hamiltonian test
bartandrews c6621ca
Merge branch 'main' into mpo
bartandrews 7ab4480
Merge branch 'main' into mpo
kevinsung 8b4e6c1
revert mol hamiltonian test comparison
kevinsung 864b0b0
update test
kevinsung fb7f9a8
simplify bitstring_to_mps
kevinsung f4f63c8
simplify molecular hamiltonian MPO (sign issue still present)
kevinsung 74e4579
simplify test
kevinsung fc11ae3
add test case
kevinsung 49a0b56
catch trivial one_body_tensor parameter
bartandrews e72e733
Merge branch 'qiskit-community:main' into mpo
bartandrews 8e67e27
add correct TeNPy version in dependencies (post license change to Apa…
bartandrews 4a97669
make one_body_tensor a required parameter of MolecularHamiltonianMPOM…
bartandrews a451c69
touch one_body_tensor
bartandrews f53f6aa
map from ffsim to TeNPy ordering in bitstring_to_mps
bartandrews 83e4bbe
make gates consistent with ffsim-TeNPy ordering
bartandrews e949554
simplify util.py
bartandrews 3187c7a
add util_test.py
bartandrews 5f8cf92
implement PR corrections
bartandrews 003c15d
implement PR corrections 2
bartandrews dd551ef
use random state vector and MPS for tests
bartandrews e352701
reintroduce optimized loops for constructing Hamiltonian MPO
bartandrews cdb5341
Merge branch 'qiskit-community:main' into mpo
bartandrews 90b52c1
integrate bitstring_to_mps functionality into statevector_to_mps
bartandrews a02a415
update year to 2025
bartandrews 2de5f5c
make nelec docstring consistent
bartandrews 7b8b958
type importing annotations from __future__
bartandrews 82d72ba
revert importing annotations from __future__
bartandrews affd4ee
try removing diag_coulomb_test.py
bartandrews 9175fd1
reintroduce diag_coulomb_test.py
bartandrews 9140f2e
try removing lucj_mps.ipynb
bartandrews b2e0c0e
reintroduce lucj_mps.ipynb
bartandrews 895b069
try type hint in diag_coulomb.py
bartandrews c71729d
add strict mypy type hints
bartandrews 27d1065
try adding type hint to line in diag_coulomb.py
bartandrews c194882
revert changes to diag_coulomb.py
bartandrews c084141
try unintegrating bitstring_to_mps from statevector_to_mps
bartandrews efb83b3
revert changes
bartandrews 076cfcf
revert to previous version
bartandrews 39ec3c9
revert lucj_mps.ipynb
bartandrews 6e113e6
revert __init__
bartandrews 4b33940
revert back to last CI passing commit
bartandrews 76ed340
Revert "revert back to last CI passing commit"
bartandrews e8687ca
Revert "revert __init__"
bartandrews 3674c0b
Revert "revert lucj_mps.ipynb"
bartandrews db21dec
Revert "revert to previous version"
bartandrews 27f2176
Revert "revert changes"
bartandrews 8a2f6bc
Revert "try unintegrating bitstring_to_mps from statevector_to_mps"
bartandrews e862d50
Merge branch 'main' into mpo
kevinsung 91449da
use ffsim.hartree_fock_state in notebook
kevinsung b18bb45
simplify code
kevinsung efdf6d4
use binary and add comments
kevinsung f312e97
simplify diag gates
kevinsung bbaa080
edit test parameters
kevinsung 4cb00c6
add dummy MPOModel for MPS-statevector conversion functions
bartandrews 005bf56
fix example notebook
bartandrews 865d513
simplify givens gate
kevinsung c91256f
use cmath.rect
kevinsung 5052bee
parallelize _map_tenpy_to_ffsim_basis
bartandrews 2cb911e
change tenpy gates tests to go up to norb=3
bartandrews 3bb86c2
revert joblib parallelization
bartandrews c854d83
Merge branch 'qiskit-community:main' into mpo
bartandrews acf7a90
use tenpy MolecularModel
bartandrews 8244430
remove MolecularHamiltonianMPOModel class
bartandrews File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,7 @@ | ||
| ffsim.tenpy | ||
| =========== | ||
|
|
||
| .. automodule:: ffsim.tenpy | ||
| :members: | ||
| :special-members: | ||
| :show-inheritance: |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -9,5 +9,6 @@ ffsim.linalg | |
| ffsim.optimize | ||
| ffsim.qiskit | ||
| ffsim.random | ||
| ffsim.tenpy | ||
| ffsim.testing | ||
| ``` | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
| :maxdepth: 1 | ||
|
|
||
| lucj | ||
| lucj_mps | ||
| entanglement-forging | ||
| fermion-operator | ||
| qiskit-circuits | ||
|
|
||
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,39 @@ | ||
| # (C) Copyright IBM 2024. | ||
| # | ||
| # This code is licensed under the Apache License, Version 2.0. You may | ||
| # obtain a copy of this license in the LICENSE.txt file in the root directory | ||
| # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. | ||
| # | ||
| # Any modifications or derivative works of this code must retain this | ||
| # copyright notice, and modified files need to carry a notice indicating | ||
| # that they have been altered from the originals. | ||
|
|
||
| """Code that uses TeNPy, e.g. for emulating quantum circuits.""" | ||
|
|
||
| from ffsim.tenpy.circuits.gates import ( | ||
| cphase1, | ||
| cphase2, | ||
| gate1, | ||
| gate2, | ||
| phase, | ||
| sym_cons_basis, | ||
| xy, | ||
| ) | ||
| from ffsim.tenpy.circuits.lucj_circuit import lucj_circuit_as_mps | ||
| from ffsim.tenpy.hamiltonians.lattices import MolecularChain | ||
| from ffsim.tenpy.hamiltonians.molecular_hamiltonian import MolecularHamiltonianMPOModel | ||
| from ffsim.tenpy.util import product_state_as_mps | ||
|
|
||
| __all__ = [ | ||
| "cphase1", | ||
| "cphase2", | ||
| "gate1", | ||
| "gate2", | ||
| "lucj_circuit_as_mps", | ||
| "MolecularChain", | ||
| "MolecularHamiltonianMPOModel", | ||
| "phase", | ||
| "product_state_as_mps", | ||
| "sym_cons_basis", | ||
| "xy", | ||
| ] |
This file contains hidden or 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,9 @@ | ||
| # (C) Copyright IBM 2024. | ||
| # | ||
| # This code is licensed under the Apache License, Version 2.0. You may | ||
| # obtain a copy of this license in the LICENSE.txt file in the root directory | ||
| # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. | ||
| # | ||
| # Any modifications or derivative works of this code must retain this | ||
| # copyright notice, and modified files need to carry a notice indicating | ||
| # that they have been altered from the originals. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.