### Installation Source: https://docs.quantinuum.com/tket/extensions/pytket-qiskit/index.html Install pytket-qiskit using pip. This will also install pytket if not already present. ```APIDOC ## Installation To install pytket-qiskit, run the following command: ```bash pip install pytket-qiskit ``` This command will install `pytket` if it is not already installed and add new classes and methods to the `pytket.extensions` namespace. ``` -------------------------------- ### Installation Source: https://docs.quantinuum.com/tket/extensions/pytket-qulacs Instructions for installing the pytket-qulacs library and the GPU-accelerated version. ```APIDOC ## Installation To install pytket-qulacs, run: ``` pip install pytket-qulacs ``` For GPU acceleration, first install the CUDA toolset and then install qulacs-gpu: ``` pip install qulacs-gpu ``` ``` -------------------------------- ### Run Circuit and Get Metadata with IQMBackend Source: https://docs.quantinuum.com/tket/extensions/pytket-iqm/api.html Example demonstrating how to run a circuit on an IQM backend, process circuits, retrieve results, and fetch metadata including qubit mapping. Supports specifying the number of shots and a timeout for the job. ```python n_shots = 100 backend.run_circuit(circuit, n_shots=n_shots, timeout=30) handle = backend.process_circuits([circuit], n_shots=n_shots)[0] result = backend.get_result(handle) metadata = backend.get_metadata(handle) print([qm.physical_name for qm in metadata.request.qubit_mapping]) ``` -------------------------------- ### Install pytket-qiskit Source: https://docs.quantinuum.com/tket/extensions/pytket-qiskit/_sources/index.md.txt Install the pytket-qiskit extension using pip. This command also installs pytket if it is not already present. ```bash pip install pytket-qiskit ``` -------------------------------- ### Install pytket and extensions Source: https://docs.quantinuum.com/tket/user-guide/_downloads/d922c7adacb2f32bc2e4c3ecd7e6f7c3/backends_example.ipynb Install the core pytket package along with necessary provider extensions and openfermion. ```bash pip install pytket pytket-qiskit pytket-projectq openfermion ``` -------------------------------- ### Install Quantinuum Emulator Source: https://docs.quantinuum.com/tket/extensions/pytket-quantinuum Commands to install the necessary packages for local emulation of Quantinuum circuits. ```bash pip install pytket-quantinuum[pecos] ``` ```bash uv pip install pytket-pecos --prerelease=allow ``` -------------------------------- ### Install pytket-qulacs Source: https://docs.quantinuum.com/tket/extensions/pytket-qulacs/_sources/index.rst.txt Standard installation command for the pytket-qulacs package. ```bash pip install pytket-qulacs ``` -------------------------------- ### Install pytket extension modules Source: https://docs.quantinuum.com/tket/api-docs/_sources/install.md.txt Command to install additional pytket-X modules, where X is the target framework. ```bash pip install pytket-X ``` -------------------------------- ### Install pytket Source: https://docs.quantinuum.com/tket/api-docs/_sources/getting_started.md.txt Install the pytket package and tket compiler binaries using pip. ```bash pip install pytket ``` -------------------------------- ### Setup Circuit Renderer with Fallback Source: https://docs.quantinuum.com/tket/user-guide/_downloads/a72d4b407bcc3c831a20f7353744a159/compilation_example.ipynb This script loads the Vue.js framework and the pytket-circuit-renderer library. It includes fallback mechanisms to load these resources from jsdelivr if unpkg is unavailable. This setup is necessary for rendering quantum circuits in a web environment. ```javascript ``` -------------------------------- ### Install pytket-pennylane Source: https://docs.quantinuum.com/tket/extensions/pytket-pennylane/index.html Use pip to install the extension package in your Python environment. ```bash pip install pytket-pennylane ``` -------------------------------- ### Install Quantinuum Backend with Pecos Source: https://docs.quantinuum.com/tket/extensions/pytket-quantinuum/_sources/index.md.txt Installs the pytket-quantinuum package with the pecos emulator option. ```bash pip install pytket-quantinuum[pecos] ``` -------------------------------- ### Install pytket-braket Source: https://docs.quantinuum.com/tket/extensions/pytket-braket/index.html Install the pytket-braket extension using pip. Requires an Amazon Braket account. ```bash pip install pytket-braket ``` -------------------------------- ### Install pytket-iqm via pip Source: https://docs.quantinuum.com/tket/extensions/pytket-iqm/_sources/index.rst.txt Use this command to install the pytket-iqm extension for Python environments. ```bash pip install pytket-iqm ``` -------------------------------- ### Install pytket-iqm Source: https://docs.quantinuum.com/tket/extensions/pytket-iqm Install the pytket-iqm extension using pip. This command is used to add the library to your Python environment. ```bash pip install pytket-iqm ``` -------------------------------- ### Basic Circuit Compilation Example Source: https://docs.quantinuum.com/tket/user-guide/examples/backends/creating_backends.html This example demonstrates adding gates to a circuit and printing the result of running it. It uses QubitPauliString for gate definition. ```python circ.add_gate(QubitPauliString(Qubit(0), Pauli.Z), -np.pi / 2) circ.add_gate(QubitPauliString(Qubit(1), Pauli.X), -np.pi / 2) circ.add_gate(QubitPauliString({Qubit(0): Pauli.Z, Qubit(1): Pauli.X}), np.pi / 2) print(run_mycircuit(circ)) ``` -------------------------------- ### Initialize QuantinuumBackend Source: https://docs.quantinuum.com/tket/extensions/pytket-quantinuum/_sources/index.md.txt Example of setting up a circuit and initializing a Quantinuum backend. ```python from pytket import Circuit from pytket.extensions.quantinuum import QuantinuumBackend circ = Circuit(2).H(0).CX(0, 1).CZ(0, 1) backend = QuantinuumBackend('H2-1E') ``` -------------------------------- ### Initialize IBMQEmulatorBackend Source: https://docs.quantinuum.com/tket/user-guide/_downloads/156628c2393654f0b29d4758749fdf48/qiskit_integration.ipynb Set up a pytket IBMQEmulatorBackend to simulate noisy device characteristics. ```python from pytket.extensions.qiskit import IBMQEmulatorBackend b_emu = IBMQEmulatorBackend("ibm_kyiv", instance="ibm-q/open/main") ``` -------------------------------- ### Install Qulacs with GPU Acceleration Source: https://docs.quantinuum.com/tket/extensions/pytket-qulacs/index.html To utilize the QulacsGPUBackend for faster simulation on CUDA-enabled GPUs, first install the CUDA toolset. Then, install the qulacs-gpu package. ```bash pip install qulacs-gpu ``` -------------------------------- ### Local Emulators Setup Source: https://docs.quantinuum.com/tket/extensions/pytket-quantinuum Instructions for setting up and using local emulators for the Quantinuum backend. ```APIDOC ## Local Emulators If `pytket-quantinuum` is installed with the `pecos` option: ```bash pip install pytket-quantinuum[pecos] ``` For `uv` virtual environments it is possible that this does not work, because prereleases are not picked up automatically. This can be solved by installing the latest `pytket-pecos` version via: ```bash uv pip install pytket-pecos --prerelease=allow ``` then it is possible to run circuits on an emulator running on the local machine. Currently this emulation is noiseless. ``` -------------------------------- ### Initialize Circuit Renderer Environment Source: https://docs.quantinuum.com/tket/user-guide/_downloads/f32d5da976ec5cfd7b1586757fa22371/circuit_generation_example.ipynb This script sets up the environment for rendering quantum circuits by loading Vue and the pytket circuit renderer, with fallback mechanisms for CDN availability. ```html