Qualtran

Invent, express, and analyze fault-tolerant quantum algorithms

Qualtran combines a set of abstractions for representing quantum programs, a Python library of quantum algorithms written using those abstractions, and facilities for analyzing the algorithms. Qualtran also provides a graphical interface for estimating the physical resources (qubits, magic states, and more) needed to run a quantum program. Together, these features enable advanced research into fault-tolerant quantum algorithms.

import sympy

from qualtran.bloqs.cryptography.rsa import ModExp
from qualtran.resource_counting import get_cost_value, QECGatesCost
from qualtran.drawing import show_bloq

n = sympy.Symbol('n')
modexp = ModExp(base=4, mod=15, exp_bitsize=3, x_bitsize=n)
cost = get_cost_value(modexp, QECGatesCost())
print(cost)

composite_bloq = modexp.decompose_bloq()

# See a visual representation of the composite bloq from
# within a Jupyter notebook.
show_bloq(composite_bloq)

Resources

Learn about Bloqs

Try out using Qualtran with Pennylane