cirq.CircuitFunction

A function that maps from a given set of parameters to a circuit.

name The name of the function.
circuit The circuit body. If mutable, it will be frozen.
function_params The sequence of sympy Symbols that specify the parameters of the CircuitFunction. If None, defaults to all symbols in circuit, sorted alphabetically by name.

TypeError If name is not a str, circuit is not an AbstractCircuit, or any item in function_params is not a sympy.Symbol.
ValueError If name is empty or if duplicate parameters are provided.

circuit Returns the unsubstituted circuit returned by the function.
function_params Returns a tuple of the symbols representing the function parameters.
name Returns the name of the circuit function.

Methods

all_qubits

View source

Returns the set of all qubits in the circuit.

__call__

View source

Call the circuit function with the given parameter values.

Args
args The values of some/all function parameters to use.
kwargs The values of some/all function parameters provided as keywords.

Returns
The circuit body with the function parameters substituted by the arg values.

Raises
TypeError If the CircuitFunction is called with duplicate values for a single parameter, the incorrect number of parameters is provided, or an unrecognized keyword argument is provided.

__eq__

View source

__ne__

View source