Calculate the expectation value of circuits wrt some operator(s)
tfq.math.mps_1d_expectation(
programs, symbol_names, symbol_values, pauli_sums, 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 compute the expectation values of pauli_sums
on the final states. 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 specificed by programs, following the ordering
dictated by symbol_names .
|
pauli_sums
|
tf.Tensor of strings with shape [batch_size, n_ops]
containing the string representation of the operators that will
be used on all of the circuits in the expectation calculations.
|
bond_dim
|
Integer value used for the bond dimension during simulation.
|
Returns |
tf.Tensor with shape [batch_size, n_ops] that holds the
expectation value for each circuit with each op applied to it
(after resolving the corresponding parameters in).
|