-
-
Notifications
You must be signed in to change notification settings - Fork 18
added Fermionic and Jordan-Wigner MPO encodings of 1D Fermi-Hubbard model #220
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
Merged
aaronleesander
merged 22 commits into
munich-quantum-toolkit:main
from
thilomueller:1D_Fermi_Hubbard_MPO
May 15, 2026
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
ca79aa8
changing resolution mode in lockfile from `lowest-direct` vs. `highest`
thilomueller fa9d800
initial version of 1D Fermi-Hubbard MPO
thilomueller d771522
corrected dimensions of inner matrix-valued operators in 1D FH MPO
thilomueller cd82abf
added unit tests
thilomueller e221c4c
Merge remote-tracking branch 'origin/main' into 1D_Fermi_Hubbard_MPO
thilomueller f1d74e9
implemented 1D Fermi-Hubbard MPO construction after JW transformation
thilomueller e89880e
Merge branch 'munich-quantum-toolkit:main' into 1D_Fermi_Hubbard_MPO
thilomueller c4242e1
🎨 pre-commit fixes
pre-commit-ci[bot] 458c13a
fixed missing ValueError in docstring of init_1d_fermi_hubbard_jw_pau…
thilomueller 4186ea1
Merge branch '1D_Fermi_Hubbard_MPO' of github.com:thilomueller/mqt-ya…
thilomueller fa9169e
changed variable names in init_1d_fermi_hubbard_jw_pauli to lower case
thilomueller 96815f7
cover ValueError in init_1d_fermi_hubbard_jw_pauli test case
thilomueller 73ae8fe
Merge branch 'main' into pr/220
aaronleesander 579f64f
merge main
aaronleesander a97e880
fixed broken uv
aaronleesander f49fe37
Merge branch 'main' into pr/220
aaronleesander 43a467c
added Fermi Hubbard example
aaronleesander 253e92e
fixed sign
aaronleesander 6ec985f
added stronger tests for Fermi Hubbard Hamiltonian
aaronleesander 61433ca
updated changelog
aaronleesander f31733c
changed construction to use pauli sum
aaronleesander 38f1bb0
updated changelog and pre-commit
aaronleesander 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
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,61 @@ | ||
| --- | ||
| file_format: mystnb | ||
| kernelspec: | ||
| name: python3 | ||
| mystnb: | ||
| number_source_lines: true | ||
| execution_timeout: 300 | ||
| --- | ||
|
|
||
| # 1D Fermi-Hubbard MPO | ||
|
|
||
| This example shows how to build a 1D Fermi-Hubbard Hamiltonian as an MPO using {class}`~mqt.yaqs.core.data_structures.networks.MPO.fermi_hubbard_1d`. | ||
|
|
||
| YAQS supports two representations: | ||
|
|
||
| - **Fermionic sites** (default): one site with local dimension 4 per physical lattice site. | ||
| Ladder operators act on a composite ↑/↓ basis per site; this is not a Jordan–Wigner qubit chain | ||
| across sites, but matches the standard tensor-product embedding of site Fock spaces. | ||
| - **Jordan-Wigner Pauli chain** (`jordan_wigner=True`): qubits in the order 1↑, 1↓, 2↑, 2↓, … with | ||
| local dimension 2 and full JW signs between spin orbitals. Use this mode for Pauli-string / | ||
| qubit simulators. | ||
|
|
||
| The Hamiltonian (open boundaries, no chemical potential) is | ||
|
|
||
| $$ | ||
| H = -t \sum_{i,\sigma} \left(c^\dagger_{i,\sigma} c_{i+1,\sigma} + \mathrm{h.c.}\right) | ||
| + U \sum_i n_{i,\uparrow} n_{i,\downarrow}. | ||
| $$ | ||
|
|
||
| ## Fermionic MPO | ||
|
|
||
| ```{code-cell} ipython3 | ||
| from mqt.yaqs.core.data_structures.networks import MPO | ||
|
|
||
| num_sites = 4 | ||
| t = 1.0 | ||
| u = 0.5 | ||
|
|
||
| h_mpo = MPO.fermi_hubbard_1d(num_sites, t=t, u=u) | ||
| print(f"sites={h_mpo.length}, local dim={h_mpo.physical_dimension}, matrix shape={h_mpo.to_matrix().shape}") | ||
| ``` | ||
|
|
||
| The single-site basis is $|0\rangle, |\!\downarrow\rangle, |\!\uparrow\rangle, |\!\uparrow\downarrow\rangle$ (NumPy `kron` ordering for $|\!\uparrow\rangle \otimes |\!\downarrow\rangle$). | ||
|
|
||
| ## Jordan-Wigner MPO | ||
|
|
||
| For the same model on $L$ physical sites, pass `length=2 * L` spin orbitals: | ||
|
|
||
| ```{code-cell} ipython3 | ||
| num_orbitals = 2 * num_sites | ||
|
|
||
| h_jw = MPO.fermi_hubbard_1d(num_orbitals, t=t, u=u, jordan_wigner=True) | ||
| print(f"orbitals={h_jw.length}, local dim={h_jw.physical_dimension}, matrix shape={h_jw.to_matrix().shape}") | ||
| ``` | ||
|
|
||
| ## Relation to the Trotter circuit helper | ||
|
|
||
| {func}`~mqt.yaqs.core.libraries.circuit_library.create_1d_fermi_hubbard_circuit` builds a **digital** Trotter circuit on separate ↑ and ↓ registers and can include a chemical potential $\mu$. | ||
| The MPO factories above target the **analog** Hamiltonian without $\mu$ and use either fermionic operators or an interleaved JW layout. | ||
|
|
||
| For digital simulation of the circuit model, use the circuit API; for tensor-network evolution of the Hubbard Hamiltonian, use `MPO.fermi_hubbard_1d`. |
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
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.