Skip to main content

Quantum circuit simulator for particle number conserving extended matchgate circuits

Project description

ExtraFerm

pip install 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

from extraferm import outcome_probabilities

# 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
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]

Quantum Circuit

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ExtraFerm-0.0.2.tar.gz (404.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ExtraFerm-0.0.2-cp314-cp314t-musllinux_1_2_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

ExtraFerm-0.0.2-cp314-cp314t-manylinux_2_28_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ x86-64

ExtraFerm-0.0.2-cp314-cp314t-macosx_11_0_arm64.whl (286.7 kB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

ExtraFerm-0.0.2-cp314-cp314-musllinux_1_2_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

ExtraFerm-0.0.2-cp314-cp314-manylinux_2_28_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

ExtraFerm-0.0.2-cp314-cp314-macosx_11_0_arm64.whl (287.7 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

ExtraFerm-0.0.2-cp313-cp313-musllinux_1_2_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

ExtraFerm-0.0.2-cp313-cp313-manylinux_2_28_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

ExtraFerm-0.0.2-cp313-cp313-macosx_11_0_arm64.whl (287.6 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

ExtraFerm-0.0.2-cp312-cp312-musllinux_1_2_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

ExtraFerm-0.0.2-cp312-cp312-manylinux_2_28_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

ExtraFerm-0.0.2-cp312-cp312-macosx_11_0_arm64.whl (287.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

ExtraFerm-0.0.2-cp311-cp311-musllinux_1_2_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

ExtraFerm-0.0.2-cp311-cp311-manylinux_2_28_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

ExtraFerm-0.0.2-cp311-cp311-macosx_11_0_arm64.whl (287.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file ExtraFerm-0.0.2.tar.gz.

File metadata

  • Download URL: ExtraFerm-0.0.2.tar.gz
  • Upload date:
  • Size: 404.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ExtraFerm-0.0.2.tar.gz
Algorithm Hash digest
SHA256 b37330f29724c1b97bbd748a48ffd7d0ca330154157063aedb73c0f6fd7c7444
MD5 29c5e153f97c5a53b452048cd6a2af7c
BLAKE2b-256 f3f99480025bdc514d9f655468f8e70605e6a389c0c1568d792ee48c9cbf8729

See more details on using hashes here.

Provenance

The following attestation bundles were made for ExtraFerm-0.0.2.tar.gz:

Publisher: build-and-release.yml on zhassman/ExtraFerm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ExtraFerm-0.0.2-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for ExtraFerm-0.0.2-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f00042be9ef2186204d33dd6b7a28842f02b8f5c2e50b7ae13cdcee95978b3ae
MD5 9a6f9f176436ce69bce3cae74eb63896
BLAKE2b-256 de1d74d600c527b499d6767594fe19ec7bbf3cf9dc0c641d8b5dfcb4e8aa330e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ExtraFerm-0.0.2-cp314-cp314t-musllinux_1_2_x86_64.whl:

Publisher: build-and-release.yml on zhassman/ExtraFerm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ExtraFerm-0.0.2-cp314-cp314t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ExtraFerm-0.0.2-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2d1e0b07798261faba29bf313e2621701ec3c9b821925d5062b53af0d7e445ed
MD5 aacb4333cac9e07f162d79939d4950a3
BLAKE2b-256 898f1820f0b37a51ad57950287311d9f61ade708ef1946ad49c0a3ce096d8615

See more details on using hashes here.

Provenance

The following attestation bundles were made for ExtraFerm-0.0.2-cp314-cp314t-manylinux_2_28_x86_64.whl:

Publisher: build-and-release.yml on zhassman/ExtraFerm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ExtraFerm-0.0.2-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ExtraFerm-0.0.2-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9ac329d49dbe19e20e519e2f44193dac348d57e875870cd4eccd8154a13ddf5c
MD5 99557c95d94f9592bd84ec631ce109cd
BLAKE2b-256 d4372fcc1937f3d7bc0e33a1caa2f1096ca39ade59e6372f9e726770d8d580cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for ExtraFerm-0.0.2-cp314-cp314t-macosx_11_0_arm64.whl:

Publisher: build-and-release.yml on zhassman/ExtraFerm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ExtraFerm-0.0.2-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for ExtraFerm-0.0.2-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 77475d2cc01b0798562fdd6a34247b196aa238f88049020e86be5edb0ae24a5f
MD5 e4e299ff4c62270aa45b3488708cd3c4
BLAKE2b-256 d5c17e2e476228452388e7d9e1694f9e6172e4e6932dab2c62b5bff13d37acbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for ExtraFerm-0.0.2-cp314-cp314-musllinux_1_2_x86_64.whl:

Publisher: build-and-release.yml on zhassman/ExtraFerm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ExtraFerm-0.0.2-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ExtraFerm-0.0.2-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8288fe6e08a8f377ba3eabbb66b24c17d1c841dbfa92e339575c4383c8f841f6
MD5 5d8858bb72a893cf2065e84f8ab63a0c
BLAKE2b-256 cae3dc47aa3f820ef66b606a42e81c96913d16196a1beb9ae35429a91091228f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ExtraFerm-0.0.2-cp314-cp314-manylinux_2_28_x86_64.whl:

Publisher: build-and-release.yml on zhassman/ExtraFerm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ExtraFerm-0.0.2-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ExtraFerm-0.0.2-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 abdce54f60d9dadf7ea6ccaf1d0a3abecfb6c3bf6b9f87ba96c37096835ee881
MD5 e03cd92e43579d9ff5596918b6f9010c
BLAKE2b-256 014d4ac6327d2dfc220aa423b932a47f5945eca30bd306a21cd59828a66405ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for ExtraFerm-0.0.2-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: build-and-release.yml on zhassman/ExtraFerm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ExtraFerm-0.0.2-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for ExtraFerm-0.0.2-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 94fcbf70c5fafe632dab973a0c220b388e80385cd5e9cca0c7e9784d5ebd469a
MD5 fc10eaf99be5a834efc9cbeffde37b2b
BLAKE2b-256 9c5be109f53be0060b9db70591dee37ad1285c6bc5ab88430839210b24541165

See more details on using hashes here.

Provenance

The following attestation bundles were made for ExtraFerm-0.0.2-cp313-cp313-musllinux_1_2_x86_64.whl:

Publisher: build-and-release.yml on zhassman/ExtraFerm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ExtraFerm-0.0.2-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ExtraFerm-0.0.2-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7ebd630c19b68f1eb79919c69700ca56ebcd795f752973dc69bb97100948112d
MD5 de6b3cc24742a8a83c6743e565962b48
BLAKE2b-256 1b8e85dce03106bce8bc41566503a56494befb14cb5dfd60a8f0a91c3bf52b9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ExtraFerm-0.0.2-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: build-and-release.yml on zhassman/ExtraFerm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ExtraFerm-0.0.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ExtraFerm-0.0.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c1bfe4f5cc41d156ceea303764d1996e205bf77fdb3a24933e70b7999a7a5876
MD5 6cba17738362746baa3f426bada1881b
BLAKE2b-256 bbd085502d1f7789b5328943d502d2f94647a5e705813bae7ebe43a6a61d1daa

See more details on using hashes here.

Provenance

The following attestation bundles were made for ExtraFerm-0.0.2-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: build-and-release.yml on zhassman/ExtraFerm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ExtraFerm-0.0.2-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for ExtraFerm-0.0.2-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 48d7302c1d4a707468b27ff0b5194126cbebb005fdaae73c01515612eed00014
MD5 805b45863efae6b32e4b938ef37d3173
BLAKE2b-256 cae489c724384de0b31ca361f87cdf5b486a360fbc4ef26ceff118bfa56c2d4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ExtraFerm-0.0.2-cp312-cp312-musllinux_1_2_x86_64.whl:

Publisher: build-and-release.yml on zhassman/ExtraFerm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ExtraFerm-0.0.2-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ExtraFerm-0.0.2-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 41029abaeade84fbb7ec36aeac9cf04f409a91c735f776b663d09bc28f7fc6e4
MD5 0dba6e84755b489cd66e646764afbe47
BLAKE2b-256 2d86286a529ddb12ef45a02ab1cd3d01a532b59afbf8f5d136b8fb318c30b588

See more details on using hashes here.

Provenance

The following attestation bundles were made for ExtraFerm-0.0.2-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: build-and-release.yml on zhassman/ExtraFerm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ExtraFerm-0.0.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ExtraFerm-0.0.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e84f37af14877c99714e5d685c8d03953a8e42dd2d62f1bc7cf30c841538485e
MD5 3fd838877afbfd0cd9a79ad073ebfa72
BLAKE2b-256 c20db2652b78aa43db144c6d040fe3921d24266bea44f47a1473bbb232edd54c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ExtraFerm-0.0.2-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: build-and-release.yml on zhassman/ExtraFerm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ExtraFerm-0.0.2-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for ExtraFerm-0.0.2-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 fa63440a472901a845b3acb32980cd922ed28f8a8e7ed86476336790f052a654
MD5 fa4f2181be5a11fdcf6760f0b513a633
BLAKE2b-256 5c1ffe71374f71f32a80291403e8c542a6951cde9dfdd1403ae1f8c3043c025c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ExtraFerm-0.0.2-cp311-cp311-musllinux_1_2_x86_64.whl:

Publisher: build-and-release.yml on zhassman/ExtraFerm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ExtraFerm-0.0.2-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ExtraFerm-0.0.2-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a323b2cac8f8eebffa4ccd1d8b522b96abbdc5710973086ac4eff048e4475f1a
MD5 1dfde35e0aaf477b35c1be3286042407
BLAKE2b-256 5ddae40279e348e6c956b11f7939f6cd02ef39a8aaeb15a15f098b0943d14d81

See more details on using hashes here.

Provenance

The following attestation bundles were made for ExtraFerm-0.0.2-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: build-and-release.yml on zhassman/ExtraFerm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ExtraFerm-0.0.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ExtraFerm-0.0.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9877d0696561a96a23ab7665cc3a7bd93f37bd9b64353bcf28b38f32ad6cbc0c
MD5 af2370b39468d7e896bd552dd19022a3
BLAKE2b-256 95d3f339f1c66a600b64246fb38e315ba11e2bc058efcf40c048d71e2a5e4ac7

See more details on using hashes here.

Provenance

The following attestation bundles were made for ExtraFerm-0.0.2-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: build-and-release.yml on zhassman/ExtraFerm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page