cirq.ExpressionMap

A dictionary with sympy expressions and symbols for keys and sympy symbols for values.

This is returned by cirq.flatten. See ExpressionMap.transform_sweep and ExpressionMap.transform_params.

Methods

transform_params

View source

Returns a ParamResolver to use with a circuit flattened earlier with cirq.flatten.

If params maps symbol a to 3.0 and this ExpressionMap maps a/2+1 to '<a/2 + 1>' then this method returns a resolver that maps symbol '<a/2 + 1>' to 2.5.

See cirq.flatten for an example.

Args
params The params to transform.

transform_sweep

View source

Returns a sweep to use with a circuit flattened earlier with cirq.flatten.

If sweep sweeps symbol a over (1.0, 2.0, 3.0) and this ExpressionMap maps a/2+1 to the symbol '<a/2 + 1>' then this method returns a sweep that sweeps symbol '<a/2 + 1>' over (1.5, 2, 2.5).

See cirq.flatten for an example.

Args
sweep The sweep to transform.