Qitker explores quantum computation with Fibonacci anyons. It connects a simple circuit interface circuit, qubit, and qRegister to a backend that represents states in fusion spaces and performs braiding through F- and R-moves. Circuits can also be exported to Qiskit.
For the complete circuit-building API, see the API reference (D5).
- The version 1 frontend and Qiskit export are implemented and tested.
- The anyonic backend models computational and leakage states and supports physical cross-qubit braiding.
- Normal backend execution includes stored braid sequences for CX, CY, CZ, CS, CT, CCX, CCY, CCZ, CCS, and CCT.
- The circuit API and Qiskit export impose no fixed limit on the number of controls per gate. Version 1 anyonic execution supports up to two controls per gate; this does not limit the total number of qubits in a circuit.
- The physical backend represents Fibonacci anyons in a fusion-tree basis and tracks both computational and leakage states.
- It applies physical braids through F and R moves, including braids across qubit boundaries, and reports fidelity and leakage relative to the ideal logical result.
Qitker requires Python 3.11 or newer. Run the installation commands with the same Python interpreter that you use to run your programs. Installation is needed once per Python environment.
Install Qitker version 1.0.0 and its NumPy dependency from PyPI:
python -m pip install "qitker==1.0.0"
python -m pip checkFor Qiskit export support, install the optional dependency:
python -m pip install "qitker[qiskit]==1.0.0"From a checkout of this repository, install Qitker and its NumPy dependency with:
python -m pip install .For Qiskit export support, use this command instead:
python -m pip install ".[qiskit]"After installing Qitker by either method above, run the following from the repository root:
python -m pip install -r requirements.txt
python -m pip checkrequirements.txt installs Qiskit with its visualization dependencies, Qiskit Aer for simulation, SciPy for optimization, and Matplotlib for plots. The qiskit[visualization] extra also installs pylatexenc, which is required by draw("mpl"). In Python, plt is an alias for matplotlib.pyplot, not a separate package.
The qitker[qiskit] extra provides circuit export; use requirements.txt for the simulation and plotting examples below. This requirements file installs dependencies only. Qitker itself must be installed separately using one of the commands above.
The example scripts and requirements.txt are available in this repository and are not included in the installed Qitker wheel. Download them or clone the repository to run the examples. For testing the published release on another computer, use the PyPI installation commands above rather than installing from source.
from qitker import circuit, qubit
party = circuit()
aliza = qubit(party)
baruch = qubit(party)
aliza.mix()
baruch.flipIf(aliza)
result = party.measure(shots=1024)
print(result)measure() executes the circuit through Qitker's anyonic backend and returns a report containing measurements, fidelity, and leakage.
With the Qiskit dependency installed, export a circuit as a Qiskit QuantumCircuit:
from qitker import circuit, qubit
sample = circuit()
qubit(sample).mix()
qiskit_circuit = sample.exportCircuit("qiskit")
print(qiskit_circuit)Qiskit export also preserves rotation angles and controlled rotations, which are not supported by the current anyonic execution path.
Export converts the circuit's gates; it does not run the anyonic backend or add Qiskit measurement instructions. Add those instructions explicitly before sampling with Qiskit Aer.
Install requirements.txt before running this example. It exports a Bell circuit, draws it with Matplotlib, samples it in Aer, and displays a histogram:
from qitker import circuit, qubit
from qiskit import transpile
from qiskit_aer import Aer
from qiskit.visualization import plot_histogram
import matplotlib.pyplot as plt
party = circuit()
aliza = qubit(party)
baruch = qubit(party)
aliza.mix()
baruch.flipIf(aliza)
qc = party.exportCircuit("qiskit")
qc.measure(*party.getMeasuredLists())
qc.draw("mpl")
simulator = Aer.get_backend("qasm_simulator")
compiled = transpile(qc, simulator)
counts = simulator.run(compiled, shots=1024).result().get_counts()
# Display the first Qitker qubit on the left of each bitstring.
qitker_counts = {bits[::-1]: count for bits, count in counts.items()}
print(qitker_counts)
plot_histogram(qitker_counts)
plt.show()Aer simulates the exported logical gates. Its results do not include Qitker's physical braiding fidelity or leakage. Use party.measure() for those quantities. plt.show() displays figures in a desktop environment with a graphical Matplotlib backend.
Start with the project overview (D0) for the motivation, execution paths, and current limitations. The guides below explain each example.
After installing the example dependencies, run an example from the repository root:
python -B Examples/EX3_advanced_grover.py| Example | Guide | Execution and output |
|---|---|---|
| Bell and GHZ states | D1 | Qitker anyonic execution, text circuit drawings, and measurement reports |
| Simple Grover search | D2 | Qitker anyonic execution and text output |
| Advanced Grover search | D3 | Qiskit Aer simulation, circuit drawing, and a Matplotlib histogram |
| Sudoku with QAOA | D4 | Qiskit Aer simulation and SciPy optimization |
Licensed under the MIT License.