Skip to content

EntropiQ - design and run large-scale simulations of quantum systems using Tensor Networks

License

Notifications You must be signed in to change notification settings

mercicle/entropiq

Repository files navigation

Welcome

The acceleration of quantum hardware and software development is making quantum computing poised to become one of the most important technological innovations in the 21st century. Given the significant challenges remaining before surpassing the current NISQ era, one flourishing area of development is the intersection of high-performance computing for simulating many-body quantum mechanical systems so that classical in-silico simulations enable rapid prototyping and experimentation.

Now, entanglement entropy is a key quantity in quantum physics that captures how much quantum information is shared between parts of a system. Analyzing and modeling the characteristics and behavior of entanglement entropy under different system sizes, gates, and measurement regimes -- i.e., the so-called area-to-volume law phase transitions encoded by entanglement entropy -- is fundamentally important.

EntropiQ is a framework and application that enables researchers to more easily design, run and manage large-scale simulations of many-body quantum mechanical systems using Tensor Networks for running, managing, and analyzing experiments of entanglement entropy in large-scale systems.


EntropiQ Components

There are three components of EntropiQ:

  • Many-body quantum system simulation pipeline templates in Julia
    • Currently seeded with both brick-layer design and completely packed loop model with crossings (CPLC) design
    • Harnesses high-performance ITensors.jl package (based on tensor networks and Matrix Product States)
  • AWS Postgres Database for quantum simulation data and metadata management
    • Schema for managing experiment metadata, high-level simulation results, and low-level state and entropy tracking
  • Streamlit Application
    • Flexible experimental design, including: system size, gates, measurement types and rates, circuit depth and entropy calculation customization.
    • High and low-level exploratory data analysis of entanglement entropy, runtime analysis, and state probability distribution evolution animations
    • Platform statistics


Simulation of Many-body Quantum Systems

The computational challenge of simulating many-body quantum systems is the exponential increase in size of the Hilbert space:

There are many computational approaches for simulating many-body systems, such as: exact diagonalization of the quantum Hamiltonian, series expansion techniques, quantum Monte Carlo algorithms, continuous unitary transformations, coupled cluster methods, and density functional theory (DFT). These methods have various limitations that span both computational (computer memory) and with mathematical accuracy due to approximations that must be made.

An alternative method, Matrix Product States (MPS) is a powerful and unique approach limited only by the nature of the entanglement of the system (in fact, the paper explicitly warns it's a method for "slightly entangled" or "conveniently restricted" systems). Two excellent introductions to tensor networks and MPS are provided in the references.

A tensor network is a diagrammatic method for combining many low-order tensors into one higher-order "composite tensor." Tensors are represented by objects (circles, triangles, squares, and rectangles are most common), and the legs emanating from the objects represent the indices of the tensor and therefore its local rank. In a diagram, the number of satellite legs (that don't connect to an object) can be added to determine the rank (or "order") of the composite tensor.

Tensor and Contraction Examples

The MPS translates the original state vector into a local representation as follows:

MPS general equation

On the LHS, (\ket{\Psi}) is of length (2^n) and (c_{i_{1}...i_{n}}) are (2^n) complex numbers (vs. (2n) amplitudes if it were a product state). On the RHS, the (s_i) are basis states (i.e. for qubits (s_i \in {0,1})), and the (A_i^{s_i}) are square matrices of local dimension (\chi), which is the maximal Schmidt rank (from the Schmidt decomposition of (\ket{\Psi})) over all possible bipartite splittings of the (n) qubits.

As a small concrete example, consider a 2-qubit system with maximum entanglement (i.e., a "Bell State" or "EPR pair"). We begin with both qubits in (\ket{0}). First, apply a Hadamard to the first qubit, and then follow that with a 2-qubit CNOT gate between the two qubits, resulting in:

This is a maximally entangled state living in (\mathbb{C}^4), meaning given the state of the first qubit, the state of the second qubit is also known definitively. The MPS representation is:

We arrive at this equation by iteratively splitting the system into two parts (one index at a time), creating a left and right hand side (lower-order tensors). At each iteration, we perform a Singular Value Decomposition (SVD), and then finally contract the (\lambda^{i}) matrices into their left local tensors (M^{i}). This forms the tensor network of (A^{i})'s, which is the MPS, as shown below:

Iterative Decomposition


Simulation Design

The system architecture is a one-dimensional chain of qubits that undergo the so-called "brick-layer" evolution illustrated below. Here, nearest-neighbor gates and measurements are applied in an alternating even/odd pattern resembling bricks. Unary or binary gates (such as random unitaries or Clifford Gates) and projective measurements are applied in this alternating pattern, and at a certain depth (number of layers), the resulting entanglement entropy is quantified. This process is repeated a specified number of simulations for each system-size and measurement rate, and the average entanglement entropy across simulations is computed.

Brick-layer Circuit Structure

The pseudo-code for a simulation run is as follows:

for s in n_simulations:
  for q in system_sizes:
    for r in measurement_rates:
      for l in number_of_layers:
        for i in qubit_index_space:
          if (either i and l are both odd or both even):
            apply gate to qubits (i, i+1)
            if r > rand(0, 1):
                apply measurement to qubits (i, i+1)
      compute_entropy(ψ)

The 2-qubit gates are selected randomly from either Haar random unitaries or Clifford gates. After all layer iterations, the Von Neumann entropy is calculated based on the final MPS state of (\Psi) using Singular Value Decomposition (SVD) of a bi-partition of the system:

Here, (\lambda_{i} = \sum_{i,i}^2) is the square of the (i)-th singular value from the S tensor (in the Schmidt basis) from SVD. Thus, (\lambda_{i}) is the probability of observing state (i).

Relevant Papers

Quantum System Experimental Design

Bricklayer Design - "Quantum Zeno Effect and the Many-body Entanglement Transition"

Entanglement area law in superfluid 4He

Simulating Clifford's - "Hadamard-free circuits expose the structure of the Clifford group"

Measurement Protected Quantum Phases

Tensor Networks

This site is a resource for tensor network algorithms, theory, and software.

Quantum Tensor Networks in a Nutshell

The density-matrix renormalization group in the age of matrix product states

Hand-waving and Interpretive Dance: An Introductory Course on Tensor Networks

Matrix Product State Based Algorithms for Ground States and Dynamics

ITensors - very good article on measurement of local operators

A Practical Introduction to Tensor Networks: Matrix Product States and Projected Entangled Pair States

Garnet Chan "Matrix product states, DMRG, and tensor networks" (Part 1 of 2)

Garnet Chan "Matrix product states, DMRG, and tensor networks" (Part 2 of 2)

MPS Examples

Qiskit MPS

Entanglement Entropy

Quantum Entropies

"von Neumann entropy is a limiting case of the Rényi entropy lim α→1 Sα(ρ) = S(ρ) Given a family of entropies {Sα(ρ)}α, where α is some index, the entropies are monotonic in α∈ℝ" (see here).

Entanglement Entropy via the partial trace:

"Among physicists, this is often called "tracing out" or "tracing over" W to leave only an operator on V in the context where W and V are Hilbert spaces associated with quantum systems (see here)."

Partial Trace

Partial Trace Wikipedia

Misc Articles

MSFT Azure Article - very good Pauli measurement operations

Area Law

What is the difference between general measurement and projective measurement?

Validating quantum-classical programming models with tensor network simulations

Universal Quantum Simulators

Step-By-Step Onboarding

Create a db_creds.env file in the root folder with the following:

POSTGRES_DB_USERNAME=
POSTGRES_DB_PASSWORD=
POSTGRES_DB_URL=
POSTGRES_DB_PORT=5432
POSTGRES_DB_NAME=postgres

Helpful Links and Tips

Julia

To install Julia on Mac:

brew install --cask julia
brew update && brew upgrade julia

Add Julia to Path

'/Applications/Julia-1.7.app/Contents/Resources/julia/bin/julia' ln -fs "/Applications/Julia-1.7.app/Contents/Resources/julia/bin/julia" /usr/local/bin/julia or, export PATH="$PATH:/path/to//bin" or ~/.bash_profile

Julia Docs are here.

Julia Intro

Embed Julia in Python

How to call Julia code from Python

AWS Lambda Maker for Julia

Pluto for interactive Julia Dashboards

LambdaMaker.jl

Genie is a full-stack web framework that provides a streamlined and efficient workflow for developing modern web applications. It builds on Julia's strengths (high-level, high-performance, dynamic, JIT compiled), exposing a rich API and a powerful toolset for productive web development.

Deploying a Julia API with Genie

Genie Documentation

Graphs.jl

ITensors and PastaQ

Starter code to understand how to run simulations using ITensor and PastaQ was graciously provided here.

Install PastaQ:

julia> ]
pkg> add PastaQ
julia> import Pkg; Pkg.add("ITensors"); Pkg.add("StatsBase")
julia> Pkg.add(Pkg.PackageSpec(;name="PastaQ", version="0.0.18"))

After installing Itensor and PastaQ, you must run this julia> using Pkg; Pkg.update(). Add to ~/.zshrc:

export JULIA_NUM_THREADS=4

Atom Editor

juno-makes-writing-julia-awesome

Juno Update

pkg> up Atom Juno

Julia help docs

Embed Julia into Python

Online help for Streamlit and Julia Integration

StackOverflow

Streamlit Issues

PyJulia Issues

Thanks

This could not have been done without the generous support provided by the ITensors and PastaQ package developers, Matt and Giacomo. These are the two powerhouse packages used by EntropiQ.

About

EntropiQ - design and run large-scale simulations of quantum systems using Tensor Networks

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published