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.4-cp311-cp311-win_amd64.whl (95.9 kB view details)

Uploaded CPython 3.11Windows x86-64

rb_generator-0.0.4-cp311-cp311-manylinux_2_27_x86_64.whl (98.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64

rb_generator-0.0.4-cp310-cp310-win_amd64.whl (96.0 kB view details)

Uploaded CPython 3.10Windows x86-64

rb_generator-0.0.4-cp310-cp310-manylinux_2_27_x86_64.whl (98.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64

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

Uploaded CPython 3.9Windows x86-64

rb_generator-0.0.4-cp39-cp39-manylinux_2_27_x86_64.whl (98.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ x86-64

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

Uploaded CPython 3.8Windows x86-64

rb_generator-0.0.4-cp38-cp38-manylinux_2_27_x86_64.whl (98.4 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.27+ x86-64

File details

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

File metadata

File hashes

Hashes for rb_generator-0.0.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4725e71af7c65b2eb6e10f70f5992a3a647a20bb26b27438e127f8d0a9c2bed5
MD5 09cbdf3d342ae362581a60e88b8e911b
BLAKE2b-256 e429ecaff3cc1ce1c18f9ae701580e3706784383146311996ae5e1a82ce6f043

See more details on using hashes here.

File details

Details for the file rb_generator-0.0.4-cp311-cp311-manylinux_2_27_x86_64.whl.

File metadata

File hashes

Hashes for rb_generator-0.0.4-cp311-cp311-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 5745b6c731c4e15445656dcfabc2978250f45e8392dff430c3b62843c803be03
MD5 f91b2c3f0f750be13344345867f107c1
BLAKE2b-256 e13eb0e4dc3cd1e3a139184c3329127752d26f7017efd4f63461ff717fd4555e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rb_generator-0.0.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 05c330025923c0b8cfa44c0abdf3b91314e716606ee66ff51d1fcdd0ba9a46f2
MD5 2f4dd55ef1ea47bb9a2fa44162d80076
BLAKE2b-256 466d447c0b8afe5c0cc05b08d982f212e0d809d1568210d7df69a8920514a108

See more details on using hashes here.

File details

Details for the file rb_generator-0.0.4-cp310-cp310-manylinux_2_27_x86_64.whl.

File metadata

File hashes

Hashes for rb_generator-0.0.4-cp310-cp310-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 dab89f7442630167848a5840d00cb8dcc3775dc836695f8fce55842051455016
MD5 be1c1128214e3b0726c5faa808afb148
BLAKE2b-256 cfb652fd7afded65378b23bdf6629cb72e73e78bd8d46375cd346065fb0843a9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rb_generator-0.0.4-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.11.5

File hashes

Hashes for rb_generator-0.0.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 67df4c37b51171001a178d21178c6b2eb16937b6e20090815c6321abd2ecdf41
MD5 bddfdf2654ba6fecebbc124b98c0c2c6
BLAKE2b-256 3c4c860bbd85ae196b2ff040724be369d81477d03f335bb57b9fd50d6011ad22

See more details on using hashes here.

File details

Details for the file rb_generator-0.0.4-cp39-cp39-manylinux_2_27_x86_64.whl.

File metadata

File hashes

Hashes for rb_generator-0.0.4-cp39-cp39-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 745119aec3220d1910cd0864a4a2578baa6b468417a59e685f2a1e5e342b2e05
MD5 7a6f3889f642a0430bd00246e312ad5f
BLAKE2b-256 70418326b42c346f838525f2d58ce1753182f4e45066c23bd4c499c7592d3079

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rb_generator-0.0.4-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.11.5

File hashes

Hashes for rb_generator-0.0.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 9c8a8b6050ab44ce3707c8dd3c026a788650e49f1c79860a61ef1e3c8518a213
MD5 e2e300f3d0233b9f2aa0b6ba64491b70
BLAKE2b-256 ae309b69621f9c2d0da9d60a65e703f87cf2eb475eeee67def9b7161bb9752ab

See more details on using hashes here.

File details

Details for the file rb_generator-0.0.4-cp38-cp38-manylinux_2_27_x86_64.whl.

File metadata

File hashes

Hashes for rb_generator-0.0.4-cp38-cp38-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 6a74700bce97faefdbbaf1ed3539af9fcfc15a59c70d9e698bc2d4576a093d9e
MD5 c9565d378f55fb6660bceadf9a9d957b
BLAKE2b-256 0f84f648e52110848affa3a6421a0d05e859afcda6854eb04eda91f7ece2d437

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