<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/quantum/blob/v0.7.6/tensorflow_quantum/python/util.py#L728-L832) |

Return a Cirq circuit with exponential operator forms.

    tfq.util.exponential(
        operators, coefficients=None
    )

### Used in the notebooks

| Used in the tutorials |
|---|
| - [Quantum data](https://www.tensorflow.org/quantum/tutorials/quantum_data) |

Construct an exponential form of given `operators` and `coefficients`.
Operators to be exponentiated are specified in `operators` as
[`cirq.PauliSum`](https://quantumai.google/reference/python/cirq/PauliSum) or [`cirq.PauliString`](https://quantumai.google/reference/python/cirq/PauliString). Parameters are given by
`coefficients`.

Note that only operators whose standard representations consist of terms
which all commute can be exponentiated. This allows use of the identity
exp(A+B+...) = exp(A)exp(B)... else there would need to be automatic
handling of Trotterization and convergence, which is not supported yet.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `operators` | Python `list` or `tuple` of [`cirq.PauliSum`](https://quantumai.google/reference/python/cirq/PauliSum) or [`cirq.PauliString`](https://quantumai.google/reference/python/cirq/PauliString) objects to be exponentiated. Here are simple examples. Let q = cirq.GridQubit(0, 0) E.g. operator = 0.5 \* X(q) -\> exp(-i \* 0.5 \* X(q)) operator = 0.5 \* cirq.PauliString({q: cirq.I}) -\> exp(-i \* 0.5)\*np.eye(2) Be careful of the negation and the PauliString of the identity gate. |
| `coefficients` | (Optional) Python `list` of Python `str`, `float` or `sympy.Symbol` object of parameters. Defaults to None, then all coefficients of `operators` are set to 1.0. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A [`cirq.Circuit`](https://quantumai.google/reference/python/cirq/Circuit) containing exponential form of given `operators` and `coefficients`. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `TypeError` | If `operators` (or its terms) is/are of an invalid type. |

<br />