ScalarOp¶
- class ScalarOp(dims, coeff=1)[source]¶
Scalar identity operator class.
This is a symbolic representation of an scalar identity operator on multiple subsystems. It may be used to initialize a symbolic scalar multiplication of an identity and then be implicitly converted to other kinds of operator subclasses by using the
compose()
,dot()
,tensor()
,expand()
methods.Initialize an operator object.
- Parameters
dims (int or tuple) – subsystem dimensions.
coeff (Number) – scalar coefficient for the identity operator (Default: 1).
- Raises
QiskitError – If the optional coefficient is invalid.
Attributes
The default absolute tolerance parameter for float comparisons.
Return the coefficient
Return tuple (input_shape, output_shape).
Return the number of qubits if a N-qubit operator or None otherwise.
Return the qargs for the operator.
The relative tolerance parameter for float comparisons.
Methods
ScalarOp.__call__
(qargs)Return a clone with qargs set
ScalarOp.__mul__
(other)ScalarOp.add
(other)Return the linear operator self + other.
Return the adjoint of the operator.
ScalarOp.compose
(other[, qargs, front])Return the composed operator.
Return the conjugate of the operator.
Make a deep copy of current operator.
ScalarOp.dot
(other[, qargs])Return the right multiplied operator self * other.
ScalarOp.expand
(other)Return the tensor product operator other ⊗ self.
ScalarOp.input_dims
([qargs])Return tuple of input dimension for specified subsystems.
ScalarOp.is_unitary
([atol, rtol])Return True if operator is a unitary matrix.
ScalarOp.multiply
(other)Return the linear operator other * self.
ScalarOp.output_dims
([qargs])Return tuple of output dimension for specified subsystems.
Return the power of the ScalarOp.
ScalarOp.reshape
([input_dims, output_dims])Return a shallow copy with reshaped input and output subsystem dimensions.
ScalarOp.set_atol
(value)Set the class default absolute tolerance parameter for float comparisons.
ScalarOp.set_rtol
(value)Set the class default relative tolerance parameter for float comparisons.
ScalarOp.subtract
(other)Return the linear operator self - other.
ScalarOp.tensor
(other)Return the tensor product operator self ⊗ other.
Convert to a Numpy matrix.
Convert to an Operator object.
Return the transpose of the operator.
ScalarOp.__call__
(qargs)Return a clone with qargs set
ScalarOp.__mul__
(other)