English
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

qiskit.circuit.ParameterExpression.subs

ParameterExpression.subs(parameter_map, allow_unknown_parameters=False)[source]

Returns a new Expression with replacement Parameters.

Parameters
  • parameter_map (dict) – Mapping from Parameters in self to the ParameterExpression instances with which they should be replaced.

  • allow_unknown_parameters (bool) – If False, raises an error if parameter_map contains Parameters in the keys outside those present in the expression. If True, any such parameters are simply ignored.

Raises

CircuitError

  • If parameter_map contains Parameters outside those in self. - If the replacement Parameters in parameter_map would result in a name conflict in the generated expression.

Returns

A new expression with the specified parameters replaced.

Return type

ParameterExpression