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

rb_generator-0.0.4-cp311-cp311-win_amd64.whl (95.9 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.11 manylinux: glibc 2.27+ x86-64

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.10 manylinux: glibc 2.27+ x86-64

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9 manylinux: glibc 2.27+ x86-64

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

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8 manylinux: glibc 2.27+ x86-64

Supported by

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