Spanish
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

MatrixOp

class MatrixOp(primitive, coeff=1.0)[fuente]

Bases: PrimitiveOp

Class for Operators represented by matrices, backed by Terra’s Operator module.

Parámetros
  • primitive (Union[list, ndarray, spmatrix, Operator]) – The matrix-like object which defines the behavior of the underlying function.

  • coeff (Union[complex, ParameterExpression]) – A coefficient multiplying the primitive

Muestra
  • TypeError – invalid parameters.

  • ValueError – invalid parameters.

Methods Defined Here

add

Return Operator addition of self and other, overloaded by +.

adjoint

Return a new Operator equal to the Operator's adjoint (conjugate transpose), overloaded by ~.

compose

Return Operator Composition between self and other (linear algebra-style: A@B(x) = A(B(x))), overloaded by @.

equals

Evaluate Equality between Operators, overloaded by ==.

eval

Evaluate the Operator's underlying function, either on a binary string or another Operator.

exp_i

Return a CircuitOp equivalent to e^-iH for this operator H

permute

Creates a new MatrixOp that acts on the permuted qubits.

primitive_strings

Return a set of strings describing the primitives contained in the Operator.

tensor

Return tensor product between self and other, overloaded by ^.

to_instruction

Returns an Instruction equivalent to this Operator.

to_matrix

Return NumPy representation of the Operator.

to_matrix_op

Returns a MatrixOp equivalent to this Operator.

Attributes

INDENTATION = '  '
coeff

The scalar coefficient multiplying the Operator.

Tipo del valor devuelto

Union[complex, ParameterExpression]

Devuelve

The coefficient.

instance_id

Return the unique instance id.

Tipo del valor devuelto

int

num_qubits
Tipo del valor devuelto

int

parameters
primitive: Operator

The primitive defining the underlying function of the Operator.

Tipo del valor devuelto

Union[QuantumCircuit, Operator, Pauli, SparsePauliOp, OperatorBase]

Devuelve

The primitive object.

settings

Return operator settings.

Tipo del valor devuelto

Dict