ariannacrippa / QC_lattice_H

Definition of the Hamiltonian for a lattice model suitable for quantum devices
MIT License
1 stars 1 forks source link

DOI

Lattice QED Hamiltonian for Quantum Computing

This repository contains useful Python functions and classes for seamlessly designing and obtaining Quantum Electrodynamic (QED) Hamiltonians for 1D, 2D or 3D lattices with staggered fermionic degrees of freedom, i.e., Kogut and Susskind formulation[^1].

The implementation is useful for carrying out research on QED quantum simulation assisted by quantum computing and quantum algorithms, as well as for analysis and comparison with known exact-diagonalization (ED) methods. In turn, the classes in this module are compatible wirh exact diagonalization libraries and the Qiskit library.

Related work::

Installation

Before using this code, make sure you have made a dedicated Python virtual environment and installed all required dependencies.

Virtual Environment

There are many distinct ways of creating Python environments which might be suitable for different applications, e.g., Anaconda, Miniconda, PyEnv, Venv, and others. Use the one that best suits your needs.

For convenience purposes, we provide an example of how to create and activate a simple environment using Venv:

Unix Systems (Zsh and Bash):

python3 -m venv qc_lattice_h && source qc_lattice_h/bin/activate

Windows:

python -m venv qc_lattice_h && qc_lattice_h/Scripts/activate

To leave this environment, simply run 'deactivate'.

Dependencies

It is possible to install all dependencies with the command below:

pip install numpy matplotlib networkx sympy scipy qiskit iteration_utilities

Usage

This module consists of three main Python classes found in three separate files, as explained below, each focused on a particular component of QED Hamiltonian creation.

File Structure

Importing classes

To integrate this implementation into your project, one suggestion is to include the Python files in your project folder, and import the classes as shown below:

from Hamiltonian_QED_sym import HamiltonianQED_sym
from Hamiltonian_QED_oprt import HamiltonianQED_oprt
from HC_Lattice import HCLattice
from Ansaetze import *

Alternatively, one could clone the full repository (or include it as a git submodule), in which case the files would be saved in a QC_lattice_H subfolder. Make sure to update your code to reflect the different path, either by using a sys.path.append() call or by adding a prefix to your imports: HC_Lattice -> QC_lattice_H.HC_Lattice.

Examples

For code examples illustrating a typical workflow with this module, please refer to the notebooks folder and the Jupyter Notebooks examples there:

For an example of Hamiltonian design, let us consider a 2x2 OBC system as in the following figure:

where the black arrow represents the gauge field that remains dynamical after Gauss law is applied, i.e.

$$\eqalign{- E{00x} - E{00y} - q{00} &= 0 \ E{00y} - E{01x} - q{01} &= 0 \ E{00x} - E{10y} - q{10} &= 0 \ E{01x} + E{10y} - q{11} &= 0 \ q{00} + q{01} + q{10} + q{11} &= 0. }$$

After this step, the Hamiltonian will be:

$$ H{E} = \frac{g^{2} \left(E{10y}^{2} + \left(- E{10y} + q{11}\right)^{2} + \left(E{10y} + q{10}\right)^{2} + \left(- E{10y} + q{01} + q_{11}\right)^{2}\right)}{2} $$

for the electric part,

$$ H{B} = - \frac{U{10y} + h.c.}{2 g^{2}} $$

for magnetic. If matter fields are considered, then we have a mass term

$$ H{m} = m \left(\Phi{1}^{\dagger} \Phi{1} - \Phi{2}^{\dagger} \Phi{2} + \Phi{3}^{\dagger} \Phi{3} - \Phi{4}^{\dagger} \Phi_{4}\right) $$

and a kinetic term

$$ H{K} = \Omega \left(0.5 i \left(- h.c.(x) + \Phi{1}^{\dagger} \Phi{2} + \Phi{4}^{\dagger} \Phi{3}\right) - 0.5 \left(h.c.(y) + \Phi{1}^{\dagger} \Phi{4} - \Phi{2}^{\dagger} U{10y}^{\dagger} \Phi{3}\right)\right). $$

One can visualize the Hamiltonian and then decide which encoding to use and if the final expression must be written in terms of Qiskit's Pauli operators.

It is also possible to put static charges on the sites and study the static potential.

To encode the fermions for a quantum circuit implementation we consider the Jordan-Wigner formulation with:

$$ \begin{aligned}\Phij &= \Big[\prod\limits{k<j}(-i\sigma^z_k)\Big] \sigma^{+}_j,\ \Phij^{\dagger}&= \Big[\prod\limits{k<j}(i\sigma^z_k)\Big] \sigma^{-}_j. \end{aligned} $$

The dynamical charges can be written as $$q{\vec{n}} = \Phi^{\dagger} \Phi-\frac{1}{2}(1+(-1)^{n{x} +n{y} + 1}) \ \mapsto \ \ \begin{cases} \frac{I-\sigma{z}}{2}, & \text{if $\vec{n}$ even}\ -\frac{I+\sigma_{z}}{2}, & \text{if $\vec{n}$ odd} \end{cases}$$

Gray circuit

After discretizing and truncating the U(1) gauge group to the discrete group $\mathbb{Z}_{2l+1}$, the gauge fields can be represented in the electric basis as

$$\eqalign{ \hat{E} &= \sum{i=-l}^l i \ket{i}{\text{ph}}\bra{i}{\text{ph}}, \ \hat{U} &= \sum{i=-l}^{l-1} \ket{i+1}{\text{ph}}\bra{i}{\text{ph}}, \ \hat{U^\dagger} &= \sum{i=-l+1}^l \ket{i-1}{\text{ph}}\bra{i}_{\text{ph}}. }$$

For numerical calculations, it is advantageous to employ a suitable encoding that accurately represents the physical values of the gauge fields. In this work, we consider the Gray encoding. For the truncation $l=1$, we can use the circuit in the following Figure to represent a gauge field.

The action of the circuit is straightforward: starting from the state $\ket{00}$, setting both parameters $\theta_1$ and $\theta_2$ to zero allows for the exploration of the physical state $\ket{-1}_{\text{ph}}$. The introduction of a non-zero value for $\theta_1$ allows the state to change to $\ket{01}$, which represents the \textit{vacuum state} $\ket{0}_{\text{ph}}$, with a certain probability. A complete rotation occurs if $\theta_1=\pi$, resulting in the exclusive presence of the second state with a probability of 1.0. Subsequently, the second controlled gate operates only when the first qubit is $\ket{1}$, limiting the exploration to $\ket{11}$ (i.e., $\ket{1}_{\text{ph}}$) and excluding $\ket{10}$.

Circuits for larger truncations ($l=3,7,15$) are:

Feedback and Bugs

If any bugs related to installation, usage and workflow are encountered, and in case of suggestions for improvements and new features, please open a New Issue

Contributing

To assist with potential contributions, please contact the lead developer Arianna Crippa before submitting a Pull Request.

License

MIT licence

References

[^1]: Lattice fermions L Susskind - Physical Review D, 1977 - APS [^2]: P. Jordan and E. P. Wigner, Über das paulische äquivalenzverbot, in The Collected Works of Eugene Paul Wigner (Springer, New York, 1993), pp. 109–129 [^3]: JF Haase, L Dellantonio, A Celi, D Paulson, A Kan, K Jansen, CA Muschik Quantum, 2021•quantum-journal.org