---
title: MPOState (latest version)
description: API reference for qiskit_addon_mpf.backends.quimb_tebd.MPOState in the latest version of qiskit-addon-mpf
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit-addon-mpf/backends-quimb-tebd-mpo-state
---

# MPOState

*class* `MPOState(*args, **kwargs)`

[GitHub](https://github.com/Qiskit/qiskit-addon-mpf/tree/stable/0.3/qiskit_addon_mpf/backends/quimb_tebd/state.py#L39-L234)

Bases: [`MatrixProductOperator`](https://quimb.readthedocs.io/en/latest/autoapi/quimb/tensor/tensor_1d/index.html#quimb.tensor.tensor_1d.MatrixProductOperator), [`State`](/docs/api/qiskit-addon-mpf/backends#state "qiskit_addon_mpf.backends.interface.State")

An MPO enforcing the Vidal gauge.

This specialization of quimb’s existing [`quimb.tensor.MatrixProductOperator`](https://quimb.readthedocs.io/en/latest/autoapi/quimb/tensor/index.html#quimb.tensor.MatrixProductOperator) enforces the Vidal gauge throughout its existence. This ensures a stable behavior of the [`DynamicMPF`](/docs/api/qiskit-addon-mpf/dynamic#dynamicmpf "qiskit_addon_mpf.dynamic.DynamicMPF") algorithm when using the [`TEBDEvolver`](/docs/api/qiskit-addon-mpf/backends-quimb-tebd-tebd-evolver "qiskit_addon_mpf.backends.quimb_tebd.TEBDEvolver").

Initialize a [`MPOState`](#qiskit_addon_mpf.backends.quimb_tebd.MPOState "qiskit_addon_mpf.backends.quimb_tebd.MPOState") instance.

> **Hint**
>
> All arguments (positional and keyword) are simply forwarded to the [`quimb.tensor.MatrixProductOperator`](https://quimb.readthedocs.io/en/latest/autoapi/quimb/tensor/index.html#quimb.tensor.MatrixProductOperator) constructor. Additionally, the [`vidal_singular_values`](#qiskit_addon_mpf.backends.quimb_tebd.MPOState.vidal_singular_values "qiskit_addon_mpf.backends.quimb_tebd.MPOState.vidal_singular_values") attribute gets initialized to a list of empty lists of length equal to the number of sites in this MPO.

**Parameters**

- **args** – all positional arguments will be forwarded to the [`quimb.tensor.MatrixProductState`](https://quimb.readthedocs.io/en/latest/autoapi/quimb/tensor/index.html#quimb.tensor.MatrixProductState) constructor.
- **kwargs** – all keyword arguments will be forwarded to the [`quimb.tensor.MatrixProductState`](https://quimb.readthedocs.io/en/latest/autoapi/quimb/tensor/index.html#quimb.tensor.MatrixProductState) constructor.

## Attributes

### vidal\_singular\_values

Type: `list[list[float]]`

A nested list of singular values. The outer list is of equal length as this MPO itself ([`quimb.tensor.TensorNetwork1D.L`](https://quimb.readthedocs.io/en/latest/autoapi/quimb/tensor/index.html#quimb.tensor.TensorNetwork1D.L)). Every item is another list of all the singular values for determining the Vidal gauge at that site.

## Methods

### gate\_split

`gate_split(gate, where, inplace=False, conj=False, **split_opts)`

[GitHub](https://github.com/Qiskit/qiskit-addon-mpf/tree/stable/0.3/qiskit_addon_mpf/backends/quimb_tebd/state.py#L72-L196)

Apply a two-site gate and contract it back into the MPO.

The basic principle of this method is the same as that of [`quimb.tensor.MatrixProductState.gate_split()`](https://quimb.readthedocs.io/en/latest/autoapi/quimb/tensor/index.html#quimb.tensor.MatrixProductState.gate_split). However, the implementation ensures that the Vidal gauge is conserved.

**Parameters**

- **gate** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)) – the gate to be applied to the MPO. Its shape should be either `(d**2, d**2)` for a physical dimension of `d`, or a reshaped version thereof.

- **where** ([*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple)*\[*[*int*](https://docs.python.org/3/library/functions.html#int)*,* [*int*](https://docs.python.org/3/library/functions.html#int)*]*) – the indices of the sites where the gate should be applied.

- **inplace** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – whether to perform the gate application in-place or return a new [`MPOState`](#qiskit_addon_mpf.backends.quimb_tebd.MPOState "qiskit_addon_mpf.backends.quimb_tebd.MPOState") with the gate applied to it.

- **conj** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) –

  whether the gate should be applied to the lower (`conj=False`, the default, [`lower_ind()`](https://quimb.readthedocs.io/en/latest/autoapi/quimb/tensor/tensor_arbgeom/index.html#quimb.tensor.tensor_arbgeom.TensorNetworkGenOperator.lower_ind)) or upper (`conj=True`, [`upper_ind()`](https://quimb.readthedocs.io/en/latest/autoapi/quimb/tensor/tensor_arbgeom/index.html#quimb.tensor.tensor_arbgeom.TensorNetworkGenOperator.upper_ind)) indices of the underlying MPO.

  > **Note**
  >
  > This is essentially how the LHS and RHS of the [`DynamicMPF`](/docs/api/qiskit-addon-mpf/dynamic#dynamicmpf "qiskit_addon_mpf.dynamic.DynamicMPF") are differentiated, by passing their [`Evolver.conjugate`](/docs/api/qiskit-addon-mpf/backends#conjugate "qiskit_addon_mpf.backends.Evolver.conjugate") property to this argument.

- **split\_opts** – additional keyword arguments that will be forwarded to the [`quimb.tensor.tensor_split()`](https://quimb.readthedocs.io/en/latest/autoapi/quimb/tensor/index.html#quimb.tensor.tensor_split) function. These can be used to affect the truncation of the tensor before it gets contracted back into the MPO.

**Returns**

The [`MPOState`](#qiskit_addon_mpf.backends.quimb_tebd.MPOState "qiskit_addon_mpf.backends.quimb_tebd.MPOState") with the `gate` applied and contracted.

**Return type**

[*MPOState*](#qiskit_addon_mpf.backends.quimb_tebd.MPOState "qiskit_addon_mpf.backends.quimb_tebd.state.MPOState")

### gate\_split\_

`gate_split_(gate, where, *, inplace=True, conj=False, **split_opts)`

**Parameters**

- **gate** (*np.ndarray*)
- **where** ([*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple)*\[*[*int*](https://docs.python.org/3/library/functions.html#int)*,* [*int*](https://docs.python.org/3/library/functions.html#int)*]*)
- **inplace** ([*bool*](https://docs.python.org/3/library/functions.html#bool))
- **conj** ([*bool*](https://docs.python.org/3/library/functions.html#bool))

**Return type**

[MPOState](#qiskit_addon_mpf.backends.quimb_tebd.MPOState "qiskit_addon_mpf.backends.quimb_tebd.MPOState")

### overlap

`overlap(initial_state)`

[GitHub](https://github.com/Qiskit/qiskit-addon-mpf/tree/stable/0.3/qiskit_addon_mpf/backends/quimb_tebd/state.py#L201-L234)

Compute the overlap of this state with the provided initial state.

> **Warning**
>
> This implementation only supports instances of [`quimb.tensor.MatrixProductState`](https://quimb.readthedocs.io/en/latest/autoapi/quimb/tensor/index.html#quimb.tensor.MatrixProductState) for `initial_state`.

**Parameters**

**initial\_state** ([*Any*](https://docs.python.org/3/library/typing.html#typing.Any)) – the initial state with which to compute the overlap.

**Raises**

[**TypeError**](https://docs.python.org/3/library/exceptions.html#TypeError) – if the provided initial state has an incompatible type.

**Returns**

The overlap of this state with the provided one.

**Return type**

[complex](https://docs.python.org/3/library/functions.html#complex)
