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:
Full tensor network contraction: use
tk_to_tensor_network
to translate apytket
circuit to aTensorNetwork
and obtain expectation values and amplitudes via full tensor network contraction usingcuQuantum
’s optimised contraction path.Matrix Product State (MPS): use
simulate
to simulate apytket
circuit, returning anMPS
representation of the output state, of which you can thenget_amplitude
or calculate inner products with other MPS viavdot
.
Currently, only single-GPU calculations are supported, but a multi-GPU execution will be
implemented in the due course using mpi4py
library.
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 with an NVIDIA GPU of Compute Capability +7.0 (check it here) and first install cuQuantum Python
following their installation
instructions.
This will include the necessary dependencies such as CUDA toolkit. Then, to install
pytket-cutensornet
, run:
pip install pytket-cutensornet
- API documentation
CuTensorNetHandle
- General state (exact) simulation
- Structured state evolution
- Simulation
- Classes
StructuredState
StructuredState.is_valid()
StructuredState.apply_gate()
StructuredState.apply_unitary()
StructuredState.apply_scalar()
StructuredState.vdot()
StructuredState.sample()
StructuredState.measure()
StructuredState.postselect()
StructuredState.expectation_value()
StructuredState.get_fidelity()
StructuredState.get_statevector()
StructuredState.get_amplitude()
StructuredState.get_qubits()
StructuredState.get_byte_size()
StructuredState.get_device_id()
StructuredState.update_libhandle()
StructuredState.copy()
TTNxGate
MPSxGate
MPSxMPO
- Miscellaneous
- Changelog