TensorNetworkQuantumSimulator.jl simulates quantum circuits, quantum dynamics and equilibrium physics with tensor networks on lattices of nearly any geometry: square, heavy-hex, Lieb, kagome, 3D cubic, trees or your own graph. Gates are applied directly to the tensor network state with controllable truncation, and expectation values, partition functions and samples can be computed with belief propagation, boundary MPS or CTMRG.
New in v0.5
- CTMRG for finite planar networks, with
eigandsvdprojectors, alongside BP and boundary MPS (in the spirit of arXiv:2609.05598). - Run circuits from Qiskit. Import OpenQASM 2 from Python Qiskit, Cirq, PennyLane or by hand with
circuit_from_qasm, or Qiskit.jl circuits directly withcircuit_from_qiskit. Every one- and two-qubit Qiskit standard gate is supported, in Qiskit’s parameter conventions. - Faster BP: specialised message-passing kernels, about 30% faster with half the peak memory in our tests.
- A
TensorInterfacelayer that spells out what a tensor backend must provide, so other backends can be added later.
This release has breaking changes; see the v0.5.0 release notes on GitHub.
A Qiskit circuit in a few lines
using TensorNetworkQuantumSimulator
circuit = circuit_from_qasm(read("circuit.qasm", String)) # qiskit.qasm2.dump(qc, "circuit.qasm")
g = build_graph_from_circuit(circuit)
ψ0 = tensornetworkstate(ComplexF64, v -> "↑", g, "S=1/2")
ψ, errors = apply_gates(circuit, ψ0; apply_kwargs = (; maxdim = 16, cutoff = 1e-12))
expect(ψ, [("Z", [1]), ("ZZ", [1, 4])]; alg = "bp")
Prefer to stay in Python? The package can be called from Python with juliacall: see the “Using from Python” page of the docs.
IBM’s 127-qubit utility experiment on a laptop
A new docs page, “IBM’s Kicked Ising Experiment”, builds the Eagle processor’s qubit layout, runs the kicked Ising circuit of Kim et al. (Nature 2023) and measures the reported magnetisations, in under a minute.
Links
- GitHub:
github.com/JoeyT1994/TensorNetworkQuantumSimulator.jl - Docs:
joeyt1994.github.io/TensorNetworkQuantumSimulator.jl/stable - Install:
] add TensorNetworkQuantumSimulator - Cite: DOI
10.5281/zenodo.23861352, or use “Cite this repository” on GitHub
Issues and feature requests are welcome, especially around fermions and infinite tensor network states, which are next on the ToDo list.