# time_reverse_pwc

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

```python
Graph.time_reverse_pwc(pwc, *, name=None)
```

Reverse in time a piecewise-constant function.

### Parameters
* **pwc** ([*Pwc*](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Pwc.md#boulderopal.graph.Pwc)) – The piecewise-constant function $v(t)$ to reverse.
* **name** (*str* *or* *None* *,* *optional*) – The name of the node.
### Returns
The piecewise-constant function $w(t)$ defined by
$w(t)=v(\tau-t)$ for $0\leq t\leq \tau$, where
$\tau$ is the duration of $v(t)$.
### Return type
[Pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Pwc.md#boulderopal.graph.Pwc)

### SEE ALSO
[`Graph.symmetrize_pwc`](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/symmetrize_pwc.md#boulderopal.graph.Graph.symmetrize_pwc)
: Symmetrize Pwcs.

[`Graph.time_concatenate_pwc`](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/time_concatenate_pwc.md#boulderopal.graph.Graph.time_concatenate_pwc)
: Concatenate Pwcs in time.

## Notes

For more information on Pwc nodes see the [Working with time-dependent functions in
Boulder Opal](https://docs.q-ctrl.com/boulder-opal/topics/working-with-time-dependent-functions-in-boulder-opal) topic.

## Examples

Reverse a piecewise constant function.

```pycon
>>> x = graph.pwc(durations=np.array([0.1, 0.5, 0.3]), values=np.array([1, 2, 3]))
>>> graph.time_reverse_pwc(x, name="reverse")
<Pwc: name="reverse", operation_name="time_reverse_pwc", value_shape=(), batch_shape=()>
>>> result = bo.execute_graph(graph=graph, output_node_names="reverse")
>>> result["output"]["reverse"]
{
    'durations': array([0.3, 0.5, 0.1]),
    'values': array([3., 2., 1.]),
    'time_dimension': 0
}
```
