Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quantum

A collection of quantum information tools covering density-matrix operations (Python) and optimal catalyst search for pure-state conversion (C++).

Repository Structure

partials/
    density.py          # Partial transpose & partial trace for multi-qubit states
    requirements.txt    # Python dependencies
optimalCatalyst/
    algorithm.cpp       # Catalyst optimizer for entanglement-assisted state conversion

Density Matrix Operations (partials/)

Requirements

  • Python 3.10+
  • NumPy 2.4.2
pip install -r partials/requirements.txt

Usage

from density import partial_transpose_multi, partial_trace_multi

partial_transpose_multi(rho, dims, sys)

Performs the partial transpose on subsystem sys (0-based) of a density matrix rho.

Parameter Type Description
rho ndarray (D, D) Density matrix, where D = prod(dims)
dims tuple[int, ...] Dimensions of each subsystem, e.g. (2, 2, 2) for three qubits
sys int Index of the subsystem to transpose (0 = first, 1 = second, …)
# Partial transpose on qubit B of a 2-qubit state
rho_TB = partial_transpose_multi(rho, (2, 2), sys=1)

partial_trace_multi(rho, dims, keep)

Traces out all subsystems not listed in keep, returning the reduced density matrix on the kept subsystems.

Parameter Type Description
rho ndarray (D, D) Density matrix
dims tuple[int, ...] Dimensions of each subsystem
keep list[int] 0-based indices of subsystems to keep
# Trace out qubit C, keep AB
rho_AB = partial_trace_multi(rho, (2, 2, 2), keep=[0, 1])

Demo

Running density.py directly prints partial transpose and partial trace results for three example states:

python partials/density.py
  • Bell state $|\Phi^+\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle)$
  • Product state $|00\rangle\langle 00|$
  • GHZ state $\frac{1}{\sqrt{2}}(|000\rangle + |111\rangle)$

Optimal Catalyst Search (optimalCatalyst/)

Implements a randomized search algorithm that finds a catalyst state $|c\rangle$ maximizing the probability of converting a bipartite pure state $|\psi\rangle \to |\phi\rangle$ via LOCC.

Background

A deterministic conversion $|\psi\rangle \to |\phi\rangle$ is possible if and only if the Schmidt vector of $|\phi\rangle$ majorizes that of $|\psi\rangle$ (Nielsen's theorem). When this condition fails, a catalyst — an ancillary entangled state that is returned unchanged — can boost the success probability. The algorithm uses Vidal's formula for the optimal success probability:

$$P^* = \min_k \frac{E_k(\psi)}{E_k(\phi)}, \quad E_k = \sum_{i \geq k} \lambda_i$$

Requirements

  • A C++17-compatible compiler (e.g. g++, clang++, MSVC)
g++ -O2 -std=c++17 -o catalyst optimalCatalyst/algorithm.cpp

Usage

Edit the main() function in optimalCatalyst/algorithm.cpp to set the input Schmidt vectors, then run the compiled binary:

./catalyst

Example output for $|\psi\rangle = (0.4, 0.4, 0.2)$ and $|\phi\rangle = (0.5, 0.25, 0.25)$:

psi -> phi: P=1.0  deterministic=yes  catalyst=(...)
phi -> psi: P=0.8  deterministic=no   catalyst=(0.5, 0.5)

optimize_catalyst Parameters

Parameter Default Description
from_raw — Schmidt coefficients of the source state
to_raw — Schmidt coefficients of the target state
m_max 6 Maximum catalyst dimension to search over
samples_per_m 50000 Number of random catalyst samples per dimension
local_steps 2000 Local perturbation steps for polishing the best candidate
seed 12345 RNG seed for reproducibility

The function returns a Result struct with:

  • prob — optimal success probability found
  • catalyst — best catalyst Schmidt vector (empty if none improves the result)
  • deterministic — true if exact conversion is achievable

About

ECE4930 | Quantum Information Science & Computing

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages