Skip to main content

parameters

Method of SpinHalfOperator.

Overloads​

NameDescription
parameters(as_string type) -> stringReturns the Pauli-string payload of a spin-1/2 operator as a string.
parameters() -> ObjectReturns the parameter payload of a spin-1/2 operator. Parameterized operators return a list, dense or sparse operators return their defining matrix, and unsupported operators return an undefined value.
parameters(as_complex | as_matrix type) -> ComplexMatrixReturns the dense complex matrix payload of a spin-1/2 operator.
parameters(as_real | as_sparsematrix type) -> RealSparseMatrixReturns the sparse real matrix payload of a spin-1/2 operator.
parameters(as_complex | as_sparsematrix type) -> ComplexSparseMatrixReturns the sparse complex matrix payload of a spin-1/2 operator.
parameters(as_list type) -> ListReturns list-compatible spin-1/2 operator parameters as an Aleph list.
parameters(as_real | as_matrix type) -> RealMatrixReturns the dense real matrix payload of a spin-1/2 operator.

parameters(as_string type) -> string​

Returns the Pauli-string payload of a spin-1/2 operator as a string.

Parameters​

  • type: Type tag as_string.

Returns​

The Pauli word encoded by the operator.

Example​

var word = pauli_string("XYZ", [0, 2, 4]).parameters(as_string)

parameters() -> Object​

Returns the parameter payload of a spin-1/2 operator. Parameterized operators return a list, dense or sparse operators return their defining matrix, and unsupported operators return an undefined value.

Returns​

A boxed list, matrix, sparse matrix, or undefined value depending on the operator kind.

Example​

var params = RotX(pi, 0).parameters()
var mat = operator_dense(random([2,2]), [0]).parameters()

parameters(as_complex | as_matrix type) -> ComplexMatrix​

Returns the dense complex matrix payload of a spin-1/2 operator.

Parameters​

  • type: Type tag as_matrix | as_complex.

Returns​

The dense complex matrix payload.

parameters(as_real | as_sparsematrix type) -> RealSparseMatrix​

Returns the sparse real matrix payload of a spin-1/2 operator.

Parameters​

  • type: Type tag as_sparsematrix | as_real.

Returns​

The sparse real matrix payload.

parameters(as_complex | as_sparsematrix type) -> ComplexSparseMatrix​

Returns the sparse complex matrix payload of a spin-1/2 operator.

Parameters​

  • type: Type tag as_sparsematrix | as_complex.

Returns​

The sparse complex matrix payload.

parameters(as_list type) -> List​

Returns list-compatible spin-1/2 operator parameters as an Aleph list.

Parameters​

  • type: Type tag as_list.

Returns​

An Aleph list containing the operator parameters.

Example​

var angles = RotEuler(0.1, 0.2, 0.3, 0).parameters(as_list)

parameters(as_real | as_matrix type) -> RealMatrix​

Returns the dense real matrix payload of a spin-1/2 operator.

Parameters​

  • type: Type tag as_matrix | as_real.

Returns​

The dense real matrix payload.

Example​

var mat = operator_dense(matrix([[0, 1], [1, 0]], as_real), [0]).parameters(as_matrix | as_real)