<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/core/ops/math_ops/simulate_mps.py#L66-L104) |

Generate samples using the C++ MPS simulator.

#### View aliases


**Main aliases**

[`tfq.math.simulate_mps.mps_1d_sample`](https://www.tensorflow.org/quantum/api_docs/python/tfq/math/mps_1d_sample)

<br />

    tfq.math.mps_1d_sample(
        programs, symbol_names, symbol_values, num_samples, bond_dim=4
    )

Simulate the final state of `programs` given `symbol_values` are placed
inside of the symbols with the name in `symbol_names` in each circuit.
From there we will then sample from the final state. Note that this op
requires 1D non periodic circuits.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `programs` | [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor) of strings with shape \[batch_size\] containing the string representations of the circuits to be executed. |
| `symbol_names` | [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor) of strings with shape \[n_params\], which is used to specify the order in which the values in `symbol_values` should be placed inside of the circuits in `programs`. |
| `symbol_values` | [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor) of real numbers with shape \[batch_size, n_params\] specifying parameter values to resolve into the circuits specified by programs, following the ordering dictated by `symbol_names`. |
| `num_samples` | [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor) with one element indicating the number of samples to draw. |
| `bond_dim` | Integer value used for the bond dimension during simulation. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A [`tf.RaggedTensor`](https://www.tensorflow.org/api_docs/python/tf/RaggedTensor) containing the samples taken from each circuit in `programs`. ||

<br />