Generate samples using the C++ MPS simulator.
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.
Args |
programs
|
tf.Tensor of strings with shape [batch_size] containing
the string representations of the circuits to be executed.
|
symbol_names
|
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 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 with one element indicating the number of
samples to draw.
|
bond_dim
|
Integer value used for the bond dimension during simulation.
|
Returns |
A tf.RaggedTensor containing the samples taken from each circuit in
programs .
|