Statevector Backend
CuStateVecStateBackend()
A pytket Backend using GeneralState to obtain state vectors.
Constructs a new cuStateVec backend object.
Source code in pytket/extensions/custatevec/backends/custatevec_backend.py
backend_info
property
Returns information on the backend.
get_operator_expectation_value(circuit, operator)
Calculate the expectation value of a QubitPauliOperator given a quantum state prepared by a circuit.
This method computes the expectation value of a specified operator with respect to the quantum state generated by the provided state preparation circuit. It leverages cuStateVec for efficient statevector simulation and expectation value computation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
circuit
|
Circuit
|
The quantum circuit that prepares the desired quantum state. |
required |
operator
|
QubitPauliOperator
|
The operator for which the expectation value is to be calculated. |
required |
Returns:
| Type | Description |
|---|---|
float64
|
np.float64: The computed expectation value of the operator with respect to |
float64
|
the quantum state. |
Source code in pytket/extensions/custatevec/backends/custatevec_backend.py
process_circuit(circuit, n_shots=None, valid_check=True, **kwargs)
Submits circuits to the backend for running.
Source code in pytket/extensions/custatevec/backends/custatevec_backend.py
process_circuits(circuits, n_shots=None, valid_check=True, **kwargs)
Submits circuits to the backend for running.
The results will be stored in the backend's result cache to be retrieved by the corresponding get_ method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
circuits
|
Sequence[Circuit]
|
List of circuits to be submitted. |
required |
n_shots
|
int | Sequence[int] | None
|
Number of shots in case of shot-based calculation. This is unused, since this backend does not support shots. |
None
|
valid_check
|
bool
|
Whether to check for circuit correctness. |
True
|
Returns:
| Type | Description |
|---|---|
list[ResultHandle]
|
Results handle objects. |