Skip to main content

No project description provided

Project description

Randomized benchmarking for 1-qubit and 2-qubit

Install

pip install rb_generator

Usage

See test.

rb22.get_full_sequence_and_inverse_sequence

rb22 = rb_generator.RB22()

# Open file first
if not rb22.load_from_file('./rb22.dat'):
    print('load failed')
    exit(0)

# Define the clifford length
clifford_length = 100

# Generate a random sequence (each element in [0, N-1], N is the size of the clifford group)
cliffords = np.random.randint(0, rb22.N, clifford_length)
sequence, inverse_sequence = rb22.get_full_sequence_and_inverse_sequence(cliffords)

print(sequence)
print(inverse_sequence)
# You will obtain the following two outputs

# sequence = [3, 6, 5, 4, 1, 4, 4, 5, 2, 5, 3, 4, 3, 3, 6, 5, 6, 5, 4, 5, 1, 6, 3, 4, 5, 4, 4, 3, 5, 4, 3, 4, 5, 4, 6, 2, 3, 3, 4, 1, 4, 6, 5, 3, 3, 6, 3, 1, 6, 3, 6, 6, 5, 4, 3, 3, 4, 5, 4, 5, 5, 6, 4, 5, 0, 6, 5, 2, 5, 5, 4, 3, 6, 5, 2, 3, 5, 3, 6, 3, 4, 3, 4, 5, 3, 6, 6, 5, 3, 4, 5, 4, 3, 0, 3, 4, 3, 4, 2, 3, 2, 5, 1, 6, 4, 5, 6, 5, 3, 3, 6, 3, 5, 6, 5, 4, 5, 4, 3, 6, 3, 6, 5, 5, 4, 4, 5, 2, 2, 2, 1, 6, 6, 2, 3, 4, 3, 4, 5, 6, 6, 3, 6, 3, 4, 1, 4, 3, 6, 3, 0, 6, 5, 4, 5, 6, 3, 3, 4, 3, 4, 5, 6, 5, 6, 3, 2, 3, 6, 3, 0, 1, 6, 5, 6, 2, 3, 5, 4, 5, 6, 5, 6, 5]

# inverse_sequence = [5, 6]

"sequence" means the operation sequence for generating the RB sequence. "inverse_sequence" means the operation sequence for inverting the sequence to identity.

rb44.get_full_sequence_and_inverse_sequence

Same as the version of rb22.

For the definition of basic generators

They are generated by C++ enums. Find them in clifford22.h and clifford44.h

enum Generator22Enum : int
{
    Generator_I22,
    Generator_X,
    Generator_Y,
    Generator_SX,
    Generator_SY,
    Generator_SXdag,
    Generator_SYdag,
};
enum Generator44Enum : int
{
    Generator_I44,
    Generator_XI,
    Generator_IX,
    Generator_YI,
    Generator_IY,
    Generator_SX_I,
    Generator_SXdag_I,
    Generator_I_SX,
    Generator_I_SXdag,
    Generator_SY_I,
    Generator_SYdag_I,
    Generator_I_SY,
    Generator_I_SYdag,
    Generator_CZ,
};

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

rb_generator-0.0.2-cp311-cp311-win_amd64.whl (95.9 kB view details)

Uploaded CPython 3.11Windows x86-64

rb_generator-0.0.2-cp310-cp310-win_amd64.whl (96.1 kB view details)

Uploaded CPython 3.10Windows x86-64

rb_generator-0.0.2-cp39-cp39-win_amd64.whl (96.2 kB view details)

Uploaded CPython 3.9Windows x86-64

rb_generator-0.0.2-cp38-cp38-win_amd64.whl (96.2 kB view details)

Uploaded CPython 3.8Windows x86-64

File details

Details for the file rb_generator-0.0.2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for rb_generator-0.0.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e3eae162c069f9665813acf621046a66fcb0a6d24eb0435e7072c949fee027d6
MD5 c43db3b8f6029f0bdca2011e2328ce73
BLAKE2b-256 b3212832b7538a54423c22656c99bbec5cb05b92a8b34b48e93dbe6880a85d20

See more details on using hashes here.

File details

Details for the file rb_generator-0.0.2-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for rb_generator-0.0.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 fcfb88aca90e4957302474fa2b00617eff44fe3e242a40ec76ec817e239fa9f5
MD5 a133ae48e043d9c431f2b27a4d392ad8
BLAKE2b-256 aa05088f15282bced07f59bc02d81901d9526e6aa7e7fdbe228740b7334a7cdd

See more details on using hashes here.

File details

Details for the file rb_generator-0.0.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: rb_generator-0.0.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 96.2 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for rb_generator-0.0.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 345fc5f34ddf535f6a25cfa4637c439fc684160014821c8145faea4a0d292024
MD5 3159a5329eebbed41727603510899c03
BLAKE2b-256 9702c20dc94091ac28542bf1bf1153f67df94912db1f1ef1f35215d6c47f1d03

See more details on using hashes here.

File details

Details for the file rb_generator-0.0.2-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: rb_generator-0.0.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 96.2 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for rb_generator-0.0.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 c003138859b0b1bfdcf2b3592d3d4a9b307ffe2540f998d1d58501f232d53ac6
MD5 bb907b6694be58d9f75e320a2e66b744
BLAKE2b-256 471a0d7c85c82bf574367516ca54b8bc650c94ecb478ef84cf2645adeab07502

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