Randomized benchmarking for 1-qubit and 2-qubit
Install
Install from pypi
pip install rb_generator
Install from source
pip install .
Packaging
python setup.py bdist_wheel
Find wheel file in dist/rb_generator_xxxx.whl
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,
};
Metadata
Release files for rb-generator 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 2.7 MB
Release files / rb_generator-0.1.0-cp314-cp314-win_amd64.whl
| Download URL | rb_generator-0.1.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 123.5 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
051753d950112e43740bad29e54bbe4d2a5b3ec2033ca9534a2fed2b23ec5555
|
|
BLAKE2b-256 checksum How to use checksums |
7724664e268c977c1efd8f13ab1cbd8c832ae647b129de1866977e89c5e4ebbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2026.
Transparency logRelease files / rb_generator-0.1.0-cp314-cp314-win32.whl
| Download URL | rb_generator-0.1.0-cp314-cp314-win32.whl |
|---|---|
| Size | 114.5 kB |
| Tags | CPython 3.14 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
01fd25d9878a92243bf5664a0a4c7bd8b041273cdf608477e2125e612c83e170
|
|
BLAKE2b-256 checksum How to use checksums |
ae9e80567294e7e59d2628fdaf6ee93f16febf7ce467d93af366a5e54614a68b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2026.
Transparency logRelease files / rb_generator-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | rb_generator-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 302.6 kB |
| Tags | CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
8f794630c1147670eba709d2969e8a0f57e9d95deafa3ed03025272ae442d4b6
|
|
BLAKE2b-256 checksum How to use checksums |
e16871c7991e06b30ac5ec47460458f6860682546d1ad23a3d81e948b35d6bad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2026.
Transparency logRelease files / rb_generator-0.1.0-cp313-cp313-win_amd64.whl
| Download URL | rb_generator-0.1.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 120.1 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
0455c56482adcb30da005cd65c1165e4f4ace96e09a0fa155a79e7e4504bec86
|
|
BLAKE2b-256 checksum How to use checksums |
a8e6f48f834500af25595483c5326de158173cb8534fb82d5e8392749989a435
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2026.
Transparency logRelease files / rb_generator-0.1.0-cp313-cp313-win32.whl
| Download URL | rb_generator-0.1.0-cp313-cp313-win32.whl |
|---|---|
| Size | 111.3 kB |
| Tags | CPython 3.13 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
64befed493577a4f5452c03ffb59ad31077775ef6110d7ffdbfc46794180d805
|
|
BLAKE2b-256 checksum How to use checksums |
5fe3d3e3eb4fc7b596e7950897b3d93038413161052e831d95e17c5d2fb488bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2026.
Transparency logRelease files / rb_generator-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | rb_generator-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 302.6 kB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
0ed3758a2b511800007b6890b26179c3c8549af424873bb04ed171f4924e4863
|
|
BLAKE2b-256 checksum How to use checksums |
ebc341d0004e8fdffcf521f8a4b70bb18261c373c9d9b6901abdbb75e6fd23c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2026.
Transparency logRelease files / rb_generator-0.1.0-cp312-cp312-win_amd64.whl
| Download URL | rb_generator-0.1.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 120.1 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
68593eb26c86cfa795453b4a0c9b1cf26d641e480d5680532c2948bd8015ec72
|
|
BLAKE2b-256 checksum How to use checksums |
d63623f8c0e3f31ae998c1cf2fa5f9ba9cac7a69e6943bd204eac7c123a643ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2026.
Transparency logRelease files / rb_generator-0.1.0-cp312-cp312-win32.whl
| Download URL | rb_generator-0.1.0-cp312-cp312-win32.whl |
|---|---|
| Size | 111.3 kB |
| Tags | CPython 3.12 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
585bef845b904f971ff24c08f197e6cb3553603d83476b552df7584da8bbfbd8
|
|
BLAKE2b-256 checksum How to use checksums |
fd8b5d1c977fbb38e04f201fcf33fa7706e5646ea2c757d923787d85c5243cf6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2026.
Transparency logRelease files / rb_generator-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | rb_generator-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 302.6 kB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
2dd1d11a37180a78bbcd09ea06effbe4ec57a5ea59c35a5a77e617fd4145b88b
|
|
BLAKE2b-256 checksum How to use checksums |
df1c3bd53d3787d50ab5323c9fc9d17caf716bc3d48ed32140f1b70f4ce96402
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2026.
Transparency logRelease files / rb_generator-0.1.0-cp311-cp311-win_amd64.whl
| Download URL | rb_generator-0.1.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 119.1 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e41ef32cf972228b4a8c0f6fce6c52bfc3a23c037c8323e9bf5d94f3e2ca3556
|
|
BLAKE2b-256 checksum How to use checksums |
311dd4387c9e651b32fbe776bc2ad0898a5f80424dd6f48e5829df2558779676
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2026.
Transparency logRelease files / rb_generator-0.1.0-cp311-cp311-win32.whl
| Download URL | rb_generator-0.1.0-cp311-cp311-win32.whl |
|---|---|
| Size | 110.3 kB |
| Tags | CPython 3.11 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
26932184f6ac81d5509e82a7d2cfd0dfb937dfe524ae386e59779b0afaa39656
|
|
BLAKE2b-256 checksum How to use checksums |
b3c82e8ddbb588ffe52424de996ed75af7a89ed2ecaa90486209e8f5766617de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2026.
Transparency logRelease files / rb_generator-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | rb_generator-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 302.6 kB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
0f8ed6a84608ab8c84d160c6cfad4641f1ad3e74aa5e214df7520358892c2679
|
|
BLAKE2b-256 checksum How to use checksums |
dbdd63ba921f1e6111077dd55ef0a0dd3d7584c5062d7d2a72cad0c3034d9c97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2026.
Transparency logRelease files / rb_generator-0.1.0-cp310-cp310-win_amd64.whl
| Download URL | rb_generator-0.1.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 119.2 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6be74221e859c5c942cf2c3cb1328611e13dfedcbd80f870d3d4a6d0c000e21c
|
|
BLAKE2b-256 checksum How to use checksums |
81ecc25c41b8477866aea8cf230bf50254684e5213807d91b62872f6b321b44f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2026.
Transparency logRelease files / rb_generator-0.1.0-cp310-cp310-win32.whl
| Download URL | rb_generator-0.1.0-cp310-cp310-win32.whl |
|---|---|
| Size | 110.4 kB |
| Tags | CPython 3.10 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
7d3b55b771d828b70a3ed1ab3f8001aee550363727cd231668ad9ec3df5815ee
|
|
BLAKE2b-256 checksum How to use checksums |
6bca7b96593f735c5e3549ae862bfab6bedc259427db7fcbf5e1d35ad5039466
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2026.
Transparency logRelease files / rb_generator-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | rb_generator-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 302.6 kB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c920b17b11c96d336da23bebd8e24126935345837bd9c36d2f5c29a244999f62
|
|
BLAKE2b-256 checksum How to use checksums |
5665efef22c1a8e1bf403c222f5f554929155568f6f985ee604918fab7fb6e19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2026.
Transparency log