# target

Source: https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/target

```python
Graph.target(operator, filter_function_projector=None)
```

Create information about the target for system time evolution.

Nodes created with this function contain two types of information: the
target gate for the system time evolution, and the projection operator
that defines the subspace of interest for robustness.

### Parameters
* **operator** (*np.ndarray* *or* [*Tensor*](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Tensor.md#boulderopal.graph.Tensor)) – The target gate $U_\mathrm{target}$. Must be a non-zero partial
  isometry.
* **filter_function_projector** (*np.ndarray* *or* *None* *,* *optional*) – The orthogonal projection matrix $P$ onto the subspace used for
  filter function calculations. If you provide a value then it must be
  Hermitian and idempotent. Defaults to the identity matrix.
### Returns
The node containing the specified target information.
### Return type
[Target](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Target.md#boulderopal.graph.Target)

### SEE ALSO
[`Graph.infidelity_pwc`](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/infidelity_pwc.md#boulderopal.graph.Graph.infidelity_pwc)
: Total infidelity of a system with a piecewise-constant Hamiltonian.

[`Graph.infidelity_stf`](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/infidelity_stf.md#boulderopal.graph.Graph.infidelity_stf)
: Total infidelity of a system with a sampleable Hamiltonian.

## Notes

The target gate $U_\mathrm{target}$ is a non-zero partial isometry,
which means that it can be expressed in the form
$\sum_j \left|\psi_j\right>\left<\phi_j\right|$, where
$\left\{\left|\psi_j\right>\right\}$ and
$\left\{\left|\phi_j\right>\right\}$ both form (non-empty)
orthonormal, but not necessarily complete, sets. Such a target represents
a target state $\left|\psi_j\right>$ for each initial state
$\left|\phi_j\right>$. The resulting operational infidelity is 0
if and only if, up to global phase, each initial state
$\left|\phi_j\right>$ maps exactly to the corresponding final state
$\left|\psi_j\right>$.

The filter function projector $P$ is an orthogonal projection
matrix, which means that it satisfies $P=P^\dagger=P^2$. The image
of $P$ defines the set of initial states from which the calculated
filter function measures robustness.

## Examples

Define a target operation for the Pauli $X$ gate.

```pycon
>>> target_operation = graph.target(operator=np.array([[0, 1], [1, 0]]))
>>> target_operation
<Target: operation_name="target", value_shape=(2, 2)>
```

See more examples in the [How to optimize controls robust to strong noise sources](https://docs.q-ctrl.com/boulder-opal/user-guides/how-to-optimize-controls-robust-to-strong-noise-sources) user guide.
