qat.lang.AQASM.gates.ParamGate

ParamGate is generated through AbstractGate. An abstract gate instantiated by a set of parameters (such as the my_rz(0.4) from above) returns a ParamGate carrying all the necessary information to build the correct abstract syntax tree of the gate.

class qat.lang.AQASM.gates.ParamGate(abstract_gate, arity, *parameters)

Class for parametrized gates instantiated by some set of parameters. Members of this class should be automatically instantiated by the AbstractGate structure. Only instantiate if you know what you are doing.

Parameters
  • abstract_gate (AbstractGate) – the mother abstract gate

  • arity (int) – the arity of the gate (can be set to None)

  • *parameters (list<any>) – the list of parameters of the gate

bind_variables(values)

Bind the variables of the gate to some value.

Parameters

_values (map<str,any>) – the variable names/values dictionary

Returns

a fresh quantum gate

Return type

Gate

dag()

Builds a new gate that is the dagger of the initial gate.

Returns

The dagger of the gate.

Return type

Gate

display(**kwargs)

Displays the param gate (if the gate has a circuit generator).

Parameters

kwargs – key word arguments passed to the display method of the circuit

get_variables()

If the Gate is parametrized by some abstract expressions, returns the list of variables appearing in those expressions.

Returns

a list of strings

Return type

list<str>