# complex_value

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

```python
Graph.complex_value(x, y, *, name=None)
```

Create element-wise complex values from real numbers, np.ndarrays, Tensors,
Pwcs, or Stfs, that is, the real and imaginary parts.

Considering numbers and np.ndarrays as Tensors, if the two objects are of the same type,
so is the returned object. If the objects have different types, Pwcs and Stfs can operate
with a tensor (returning a Pwc or Stf, respectively).

This operation supports broadcasting between the different objects.
When operating a tensor-like object with an Stf or a Pwc, the time dimension of the
latter is ignored.

### Parameters
* **x** (*number* *or* *np.ndarray* *or* [*Tensor*](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Tensor.md#boulderopal.graph.Tensor) *or* [*Pwc*](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Pwc.md#boulderopal.graph.Pwc) *or* [*Stf*](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Stf.md#boulderopal.graph.Stf)) – The real part, $x$.
* **y** (*number* *or* *np.ndarray* *or* [*Tensor*](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Tensor.md#boulderopal.graph.Tensor) *or* [*Pwc*](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Pwc.md#boulderopal.graph.Pwc) *or* [*Stf*](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Stf.md#boulderopal.graph.Stf)) – The imaginary part, $y$.
* **name** (*str* *or* *None* *,* *optional*) – The name of the node. You can only provide a name if neither x nor y are Stfs.
### Returns
The element-wise complex number $x+iy$.
### Return type
[Tensor](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Tensor.md#boulderopal.graph.Tensor) or [Pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Pwc.md#boulderopal.graph.Pwc) or [Stf](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Stf.md#boulderopal.graph.Stf)

### SEE ALSO
[`Graph.abs`](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/abs.md#boulderopal.graph.Graph.abs)
: Absolute value of a complex object.

[`Graph.angle`](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/angle.md#boulderopal.graph.Graph.angle)
: Argument of a complex object.

[`Graph.conjugate`](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/conjugate.md#boulderopal.graph.Graph.conjugate)
: Conjugate of a complex object.

[`Graph.imag`](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/imag.md#boulderopal.graph.Graph.imag)
: Imaginary part of a complex object.

[`Graph.real`](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/real.md#boulderopal.graph.Graph.real)
: Real part of a complex object.
