Skip to main content

A package for quantum error correction with bivariate bicycle codes

Project description

QEC Bivariate Bicycle Codes

A Python package for quantum error correction using bivariate bicycle codes.

Installation

pip install bbqec

Usage

Basic Usage Example

from bbqec import BBCode

# Create a new BBCode
l = 8
m = 10
A = ['i', 'x1', 'y7', 'x6.y5']
B = ['x0', 'x5', 'y6.x7', 'x.y5']

code = BBCode(l, m, A, B)

# Find the parameters of the code
# distance_method = 4 uses bposd to calculate the distance (recommended)
n, k, d = code.generate_bb_code(distance_method=4)
print(f"Code parameters: [{n}, {k}, {d}]")

# Get parity-check matrices
H_x, H_z = code.create_parity_check_matrices()

# Create Tanner Graph
G = code.make_graph()

Optimized Version for Multiple Codes

from bbqec import BBCodeOptimised
from bbqec.helpers import ProposeParameters

# Set up parameters
l = 10
m = 8
num_codes = 50

# Create an instance of BBCodeOptimised
code = BBCodeOptimised(l, m)

# Help generate random A and B expressions
parameters = ProposeParameters(l, m)

# Generate codes
for _ in range(num_codes):
    A = parameters.draw_bivariate_monomials(num_monomials=3)
    B = parameters.draw_bivariate_monomials(num_monomials=3)
    
    code.set_expressions(A_expression=A, B_expression=B)
    n, k, d = code.find_distance(distance_method=4)
    
    print(f"Code parameters: [{n}, {k}, {d}]")

Documentation

For detailed documentation, usage examples, and more information about the API:

Features

  • Create and analyze bivariate bicycle quantum error correction codes
  • Multiple distance calculation methods
  • Optimized implementations for generating multiple codes
  • Tanner graph representation of codes
  • Polynomial helpers for working with bivariate polynomials

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

bbqec-1.4.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

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

bbqec-1.4-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file bbqec-1.4.tar.gz.

File metadata

  • Download URL: bbqec-1.4.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for bbqec-1.4.tar.gz
Algorithm Hash digest
SHA256 c6cc085470bf6f90c7a6d87f45e7e5526cdc0a903bd404939e07b67c78b92159
MD5 4b8cea4a925cad10bc31dc59ce178f73
BLAKE2b-256 9d8ea98b152547c39b29d88c5f89cd91cb4c9928dbf1f786b71b5014cd9fa912

See more details on using hashes here.

File details

Details for the file bbqec-1.4-py3-none-any.whl.

File metadata

  • Download URL: bbqec-1.4-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for bbqec-1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4122dd9c925e62c1719bcd50ce1de580812498387e83e3e2e0f2bc459abbc5d1
MD5 c277b10ab8717cf30b14723408e39971
BLAKE2b-256 00a8261c3e0b6738c1e3a20a650c70a21c9df925c83253d3deb346fe935020b3

See more details on using hashes here.

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