# time_concatenate_pwc

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

```python
Graph.time_concatenate_pwc(pwc_list, *, name=None)
```

Concatenate multiple piecewise-constant functions in the time dimension.

### Parameters
* **pwc_list** (*list* *[*[*Pwc*](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Pwc.md#boulderopal.graph.Pwc) *]*) – The individual piecewise-constant functions $\{A_i(t)\}$ to concatenate.
  All the functions must have the same value shape, and can have broadcastable
  batch shapes.
* **name** (*str* *or* *None* *,* *optional*) – The name of the node.
### Returns
The concatenated piecewise-constant function (or batch of functions).
### Return type
[Pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Pwc.md#boulderopal.graph.Pwc)

### SEE ALSO
[`Graph.pwc`](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/pwc.md#boulderopal.graph.Graph.pwc)
: Create piecewise-constant functions.

[`Graph.pwc_sum`](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/pwc_sum.md#boulderopal.graph.Graph.pwc_sum)
: Sum multiple Pwcs.

[`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_reverse_pwc`](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/time_reverse_pwc.md#boulderopal.graph.Graph.time_reverse_pwc)
: Reverse Pwcs in time.

## Notes

The function resulting from the concatenation is

$$
C(t) = \begin{cases}
A_0(t) & \mathrm{for} & 0 < t < \tau_0
\\
A_1(t - \tau_0) & \mathrm{for} & \tau_0 < t < \tau_0 + \tau_1
\\
A_2(t - \tau_0 - \tau_1) & \mathrm{for} & \tau_0 + \tau_1 < t < \tau_0 + \tau_1 + \tau_2
\\
& \vdots &
\end{cases}
$$

where $\tau_i$ is the duration of the i-th function.

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

Concatenate two piecewise-constant functions.

```pycon
>>> pwc1 = graph.pwc(durations=np.array([0.2, 0.5]), values=np.array([1, 2]))
>>> pwc2 = graph.pwc(durations=np.array([0.7, 0.9]), values=np.array([3, 4]))
>>> graph.time_concatenate_pwc([pwc1, pwc2], name="concat")
<Pwc: name="concat", operation_name="time_concatenate_pwc", value_shape=(), batch_shape=()>
>>> result = bo.execute_graph(graph=graph, output_node_names="concat")
>>> result["output"]["concat"]
{
    'durations': array([0.2, 0.5, 0.7, 0.9]),
    'values': array([1., 2., 3., 4.]),
    'time_dimension': 0
```
