infidelity_pwc
Graph.infidelity_pwc(hamiltonian, target, noise_operators=None, *, name=None)
Create the total infidelity of the given piecewise-constant system.
Use this function to compute the sum of the operational infidelity (which measures how effectively the system achieves a target gate) and filter function values (which measure how robust the system evolution is to various perturbative noise processes). This total infidelity value provides a cost that measures how effectively and robustly a set of controls achieves a target operation.
Note that the total infidelity returned by this function is at least zero, but might be larger than one (for example if the system is highly sensitive to one of the noise processes).
Parameters
- hamiltonian (Pwc) – The control Hamiltonian . You can provide either a single Hamiltonian or a batch of them.
- target (Target) – The object describing the target gate and (optionally) the filter function projector . If you provide a batch of Hamiltonians, the function uses the same target for all the elements in the batch.
- noise_operators (list [ np.ndarray or Tensor or Pwc ] or None , optional) – The perturbative noise operators . The operators in the list can either be single operators or batches of them. If any of the noise operators or the Hamiltonian are batches, the batch shapes must all be broadcastable. You can omit this list if there are no noises.
- name (str or None , optional) – The name of the node.
Returns
The total infidelity (operational infidelity plus filter function values) of the given system, with respect to the given target gate. If you provide a batch of Hamiltonians or noise operators, the function returns a batch of infidelities containing one infidelity for each Hamiltonian and list of noise operators in the input batches.
Return type
WARNING
The Hessian matrix cannot currently be calculated for a graph which includes an infidelity_pwc node if the hamiltonian has degenerate eigenvalues at any segment.
SEE ALSO
Graph.infidelity_stf
: Corresponding operation for Stf Hamiltonians.
Graph.target
: Define the target operation of the time evolution.
Graph.time_evolution_operators_pwc
: Unitary time evolution operators for quantum systems with Pwc Hamiltonians.
Notes
The total system Hamiltonian is
where are small, dimensionless, stochastic variables.
The total infidelity, as represented by this node, is the sum of the operational infidelity and the filter functions of each noise operator evaluated at zero frequency.
The operational infidelity is
where is the unitary time evolution operator due to .
The filter function for the noise operator is a measure of robustness, defined at frequency as
F_j(f) = \frac{1}{\mathrm{Tr}(P)} \mathrm{Tr} \left( P \mathcal{F} \left\\{ \tilde N_j^\prime(t) \right\\} \left[ \mathcal{F} \left\\{ \tilde N^\prime (t) \right\\} \right]^\dagger P \right),where is the Fourier transform, is the toggling-frame noise operator, and differs from only by a multiple of the identity but is trace-free on the subspace of interest. The filter function value at zero frequency quantifies the sensitivity of the controls to quasi-static noise applied via the corresponding noise operator.
Examples
Calculate infidelity of the identity gate for a noiseless single qubit.
>>> sigma_z = np.array([[1, 0], [0, -1]])
>>> hamiltonian = graph.pwc(
... durations=np.array([0.1, 0.1]), values=np.array([sigma_z, -sigma_z])
... )
>>> target = graph.target(np.eye(2))
>>> infidelity = graph.infidelity_pwc(
... hamiltonian=hamiltonian, target=target, name="infidelity"
... )
>>> result = bo.execute_graph(graph=graph, output_node_names="infidelity")
>>> result["output"]["infidelity"]["value"]
0.0
See more examples in the How to optimize controls with non-linear dependencies user guide.