pytket-cutensornet¶
pytket-cutensornet is an extension to pytket that allows pytket circuits and
expectation values to be simulated using cuTensorNet.
cuTensorNet is a high-performance library for tensor network computations, developed by NVIDIA. It is part of the cuQuantum SDK – a high-performance library aimed at quantum circuit simulations on the NVIDIA GPU chips.
We provide two core functionalities:
Exact value calculation: use
GeneralStateandGenearlBraOpKetto translate apytketinto a tensor network and obtain amplitudes and expectation values via full tensor network contraction usingcuQuantum’s optimised contraction path.Approximate state evolution: use
simulateto simulate apytketcircuit, returning a tensor network representation of the approximate output state, from which you can query properties, such as amplitudes and expectation values.
pytket-cutensornet is available for Python 3.10, 3.11 and 3.12 on Linux.
In order to use it, you need access to a Linux machine (or WSL) with an NVIDIA GPU of
Compute Capability +7.0 (check it here).
You will need to install cuda-toolkit and cuquantum-python before pytket-cutensornet;
for instance, in Ubuntu 24.04:
sudo apt install cuda-toolkit
pip install cuquantum-python
pip install pytket-cutensornet
Alternatively, you may install cuQuantum Python following their instructions
using conda-forge. This will include the necessary dependencies from CUDA toolkit. Then, you may install
pytket-cutensornet using pip.
- API documentation
- General state (exact) simulation
- Structured state evolution
- Library handle
- Simulation
- Classes
StructuredStateStructuredState.is_valid()StructuredState.apply_gate()StructuredState.apply_unitary()StructuredState.apply_scalar()StructuredState.apply_qubit_relabelling()StructuredState.vdot()StructuredState.sample()StructuredState.measure()StructuredState.postselect()StructuredState.expectation_value()StructuredState.get_fidelity()StructuredState.get_statevector()StructuredState.get_amplitude()StructuredState.get_bits()StructuredState.get_qubits()StructuredState.get_byte_size()StructuredState.get_device_id()StructuredState.update_libhandle()StructuredState.copy()
TTNxGateMPSxGateMPSxMPO
- Miscellaneous
Example Notebooks
Changelog
- Changelog
- 0.12.0 (May 2025)
- 0.11.1 (March 2025)
- 0.11.0 (March 2025)
- 0.10.2 (February 2025)
- 0.10.1 (December 2024)
- 0.10.0 (October 2024)
- 0.9.0 (October 2024)
- 0.8.0 (September 2024)
- 0.7.1 (July 2024)
- 0.7.0 (July 2024)
- 0.6.1 (April 2024)
- 0.6.0 (April 2024)
- 0.5.4 (January 2024)
- 0.5.3 (January 2024)
- 0.5.2 (December 2023)
- 0.4.0 (October 2023)
- 0.3.0 (September 2023)
- 0.2.1 (August 2023)
- 0.2.0 (July 2023)
- 0.1.0 (June 2023)
Useful links