quantum tensor simulator
contracting quantum circuits, in parallel, across a cluster.
Quantum circuits are naturally tensor networks, and contracting a tensor network efficiently is most of what makes simulating a quantum circuit tractable at all. For a Parallel & Distributed Computing course, the three of us took a serial reference implementation and rebuilt its contraction as a distributed, multithreaded pipeline.
the pipeline
community detection
METIS partitions the tensor network into communities, tightly connected clusters of tensors, chosen to minimise the connections between them.
community contraction
Each community contracts independently and in parallel. MPI spreads the communities across processes; OpenMP and native Julia threads parallelise inside each one.
final merge
The contracted communities get merged and contracted again, globally, with coordinated parallelism, into the final result.
what the driver script looks like
The entry point reads almost like a lab notebook: build a circuit, convert it to a tensor network, hand it to the contraction algorithm with a community count, and let MPI take it from there.
circuit = create_ghz_circuit(999)
tnc = convert_to_tnc(circuit)
num_communities = 8
input_state = "0"^999
output_state = "1"^999
result = ComParCPU_MPI(circuit, input_state, output_state, num_communities;
timings=true, decompose=true)credit
This extends Alfred Miquel's Multistage_contraction, adding the distributed and multithreaded execution layer on top of its serial structure. Built and benchmarked together with Tabish Noman Khan and Arqam Zia.