# constant_stf

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

```python
Graph.constant_stf(constant, batch_dimension_count=0)
```

Create a constant sampleable tensor-valued function of time.

### Parameters
* **constant** (*number* *or* *np.ndarray* *or* [*Tensor*](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Tensor.md#boulderopal.graph.Tensor)) – The constant value $c$ of the function.
  To create a batch of $B_1 \times \ldots \times B_n$ constant
  functions of shape $D_1 \times \ldots \times D_m$, provide this constant
  parameter as an object of shape
  $B_1\times\ldots\times B_n\times D_1\times\ldots\times D_m$.
* **batch_dimension_count** (*int* *,* *optional*) – The number of batch dimensions, $n$, in constant.
  If provided, the first $n$ dimensions of constant are considered
  batch dimensions. Defaults to 0, which corresponds to no batch.
### Returns
An Stf representing the constant function $f(t) = c$ for all time
$t$ (or a batch of functions, if you provide batch_dimension_count).
### Return type
[Stf](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Stf.md#boulderopal.graph.Stf)

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

[`Graph.constant_stf_operator`](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/constant_stf_operator.md#boulderopal.graph.Graph.constant_stf_operator)
: Create a constant sampleable function from operators.

[`Graph.identity_stf`](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/identity_stf.md#boulderopal.graph.Graph.identity_stf)
: Create an Stf representing the identity function.

## Notes

For more information on Stf 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.
