pygsti.models.modelconstruction.create_operation#
- create_operation(op_expr, state_space, basis='pp', parameterization='full', evotype='default')#
Build an operation object from an expression.
- Parameters:
op_expr (string) –
expression for the gate to build. String is first split into parts delimited by the colon (:) character, which are composed together to create the final gate. Each part takes on of the allowed forms:
I(ssl_0, …) = identity operation on one or more state space labels (ssl_i)
X(theta, ssl) = x-rotation by theta radians of qubit labeled by ssl
Y(theta, ssl) = y-rotation by theta radians of qubit labeled by ssl
Z(theta, ssl) = z-rotation by theta radians of qubit labeled by ssl
CX(theta, ssl0, ssl1) = controlled x-rotation by theta radians. Acts on qubit labeled by ssl1 with ssl0 being the control.
CY(theta, ssl0, ssl1) = controlled y-rotation by theta radians. Acts on qubit labeled by ssl1 with ssl0 being the control.
CZ(theta, ssl0, ssl1) = controlled z-rotation by theta radians. Acts on qubit labeled by ssl1 with ssl0 being the control.
CNOT(ssl0, ssl1) = standard controlled-not gate. Acts on qubit labeled by ssl1 with ssl0 being the control.
CPHASE(ssl0, ssl1) = standard controlled-phase gate. Acts on qubit labeled by ssl1 with ssl0 being the control.
LX(theta, i0, i1) = leakage between states i0 and i1. Implemented as an x-rotation between states with integer indices i0 and i1 followed by complete decoherence between the states.
state_space (StateSpace) – The state space that the created operation should act upon.
basis (str or Basis) – The basis the returned operation should be represented in.
parameterization ({"full","TP","static"}, optional) –
How to parameterize the resulting gate.
”full” = return a FullArbitraryOp.
”TP” = return a FullTPOp.
”static” = return a StaticArbitraryOp.
evotype (Evotype or str, optional) – The evolution type of this operation, describing how states are represented. The special value “default” is equivalent to specifying the value of pygsti.evotypes.Evotype.default_evotype.
- Returns:
A gate object representing the gate given by op_expr in the desired basis.
- Return type: