Quantum circuit simulator for particle number conserving extended matchgate circuits
Reason this release was yanked:
missing files
Project description
ExtraFerm
Overview
This library can be used to estimate Born rule probabilities of measurement outcomes from particle-number conserving extended matchgate circuits:
- Extended matchgate: the universal gate set consisting of matchgates + controlled‑phase gates
- Particle-number conserving: the Hamming weight of initial state is preserved at all points by the circuit
Circuit Extent
Our simulator runs most efficiently when the circuit’s extent is close to one. The extent is defined as:
$$ \xi^* = \prod_{j=1}^k \bigl(\cos(\theta_j/4) + \sin(\theta_j/4)\bigr)^2 $$
where $\theta_j$ is the angle of the $j$-th controlled-phase gate.
Use
Users should interact with the simulator through the outcome_probabilities function in interface.py.
Example
import numpy as np
from qiskit import QuantumCircuit
from qiskit.circuit.library import XXPlusYYGate
# Create a small circuit
seed=123
rng = np.random.default_rng(seed=seed)
angles = rng.uniform(0, 2*np.pi, size=12)
qc = QuantumCircuit(4)
qc.x([0, 2])
qc.append(XXPlusYYGate(theta=angles[0], beta=angles[1]), [0, 1])
qc.cp(theta=angles[3], control_qubit=1, target_qubit=2)
qc.append(XXPlusYYGate(theta=angles[4], beta=angles[5]), [1, 2])
qc.cp(theta=angles[6], control_qubit=0, target_qubit=1)
qc.p(theta=angles[7], qubit=0)
qc.append(XXPlusYYGate(theta=angles[8], beta=angles[9]), [2, 3])
qc.append(XXPlusYYGate(theta=angles[10], beta=angles[11]), [0, 1])
# Estimate a few bitstring probabilitites
from extraferm import outcome_probabilities
bitstrings = [0b0101, 0b1100, 0b0011]
probs = outcome_probabilities(circuit=qc,
outcome_states=bitstrings,
trajectory_count=100_000,
seed=seed)
# Show results
print(probs)
qc.draw("mpl", scale=0.8, fold=-1)
[5.09355260e-01 1.56195696e-33 8.07714813e-02]
Setup
Install this repository
git clone https://github.com/zhassman/Extended-Matchgate-Simulator.git
cd Extended-Matchgate-Simulator
pip install -e .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ExtraFerm-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: ExtraFerm-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 289.5 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d32f5da62eafef06599a235e5c5f8d8fd6931863ef2b3b781899871140923e80
|
|
| MD5 |
f279609777ade0083391bab4edec4e75
|
|
| BLAKE2b-256 |
4757c3801886ccea273b336d9c1b96002149221d027b5b2c1ec606c6737e7a97
|