inquanto-cutensornet¶
InQuanto cuTensorNet extension.
- class CuTensorNetProtocol¶
Protocol for the
pytket-cutensornet
package for tensor network simulations.- get_evaluator(parameters, allow_partial=True)¶
Returns an evaluator function to evaluate quantum computables.
This method creates and returns a function (evaluator) that takes in a specific quantum computable and evaluates it based on its type. The returned evaluator handles various computable types, such as expectation values, their derivatives, overlaps, etc.
Quantum computables the returned evaluator can handle:
- Parameters:
- Raises:
NotImplementedError – If an unsupported computable is encountered, and
allow_partial==False
.- Returns:
Callable
[[Any
],Any
] – A function that can evaluate quantum computables. If theComputable
is supported by this protocol, it is computed; otherwise, it returns theComputable
itself.
- get_runner(qc)¶
Returns an end-to-end executor function for a quantum computable.
All nodes in the quantum computable must be evaluable by this protocol. Supported computable are:
- Parameters:
qc (
ComputableNode
) – The quantum computable node to be measured and evaluated at every call of the returned function.- Returns:
Callable
[[dict
[str
|Symbol
,Union
[int
,float
,complex
,Expr
]]],Any
] – A function that takes the parameters and returns the evaluated result. If the result is not afloat
, it returnsmath.nan
.