API documentation#

class pytket.extensions.cutensornet.CuTensorNetHandle(device_id: int | None = None)#

Initialise the cuTensorNet library with automatic workspace memory management.

Note

Always use as with CuTensorNetHandle() as libhandle: so that cuTensorNet handles are automatically destroyed at the end of execution.

handle#

The cuTensorNet library handle created by this initialisation.

Type:

int

device_id#

The ID of the device (GPU) where cuTensorNet is initialised. If not provided, defaults to cp.cuda.Device().

Type:

int

destroy() None#

Destroys the memory handle, releasing memory.

Only call this method if you are initialising a CuTensorNetHandle outside a with CuTensorNetHandle() as libhandle statement.