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

Uploaded CPython 3.11Windows x86-64

rb_generator-0.0.3-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.3-cp310-cp310-win_amd64.whl (96.1 kB view details)

Uploaded CPython 3.10Windows x86-64

rb_generator-0.0.3-cp310-cp310-manylinux_2_27_x86_64.whl (98.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64

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

Uploaded CPython 3.9Windows x86-64

rb_generator-0.0.3-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.3-cp38-cp38-win_amd64.whl (96.2 kB view details)

Uploaded CPython 3.8Windows x86-64

rb_generator-0.0.3-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.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for rb_generator-0.0.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d3d6d3247e32cd641cdea2bdc29aa79a69d1ef0300675f44372d750cbcf3e267
MD5 fe7fcd3ff5f92ed230c29343d8837448
BLAKE2b-256 e612b53a4ea8ef9542efb2a0b8404dcad7f639dc728068f7eb88d00db5eb5050

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rb_generator-0.0.3-cp311-cp311-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 1e845a778b4041a2e9c18a76a87b1bbecf9d380d146bfe1871201339ac469398
MD5 b77a0156d998e1084405f6251e085fe8
BLAKE2b-256 b1bb3391ede96ee2377e18f5f7824699c3d0533b6dd785b6e136dd2c1193dfb6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rb_generator-0.0.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 022fee9fe87f88dfd22aa89a253d98a9622fc5dbd51f7088b501d2faaf50dcd1
MD5 3658eac626b2de489db740e12f8b4287
BLAKE2b-256 79518f7bb5483506141208863c35f9205b32df7cbf12372d4226e6c0b92a9d4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rb_generator-0.0.3-cp310-cp310-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 fd7b003d51d062c0fe3971dd399becab7c8875ac97d78db9cccd7089027c5408
MD5 86bc8bc6404b5a07cceb969fda3799fe
BLAKE2b-256 25a2a7e2a2bdfe28e996a23b1f127bfd53a9c7a92f77f1fe79eefbd044e97fcb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rb_generator-0.0.3-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.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c9ad4f7193326f087cb2b392cfd9017af27c2774ec6fb4a443e9534bdd170980
MD5 7a6f0d46e541bbd8e7c65e956e860656
BLAKE2b-256 16342116ca98f8e989a105374d25b37a69cc8d4cdb623562ab02d31612b4c494

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rb_generator-0.0.3-cp39-cp39-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 285a121f7da286bfdacf1eee7eb24ae9c423a5c0dc8dd2ba72ecff0bded938aa
MD5 988698c66febed535db47a259465f4ee
BLAKE2b-256 833f0eafd3915f999e85062946e17289cac73f8c97cc2e0e829508e32cddf88f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rb_generator-0.0.3-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.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 dcd5858ff73be5a131486b9036e7c5d1d4341617a71ab85dc0363e879010438e
MD5 c22a212fd762b7e57112e3ec269cb447
BLAKE2b-256 030c1d7c78ce36002def96d9e4ad722c200e228e33e0de3fb51d721ee0da3912

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rb_generator-0.0.3-cp38-cp38-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 b82732ccaab3be75c75bad681fa42579b9239bb77796498a20876f17431fae99
MD5 7afd48608c8ffea3f4658f7b95628d46
BLAKE2b-256 c1a2bca5b6ab98d0f94eb6b3747bdaa55109c3e49a0555a036609a0887d3e710

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