Matrices, vectors, and complex numbers

Look up linear algebra operations and their selectors for matrices, vectors, and complex numbers, with documented arguments and results.

Numerical computing, models, statistics, and Datasets with Python

Factor matrices and check rank

For a linear system, pass an m×n matrix A and a right-hand side B with m rows. For an invertible square system, check the residual A·X−B. For a least-squares solution, check rank and residuals. A pseudoinverse uses a threshold for singular values. The tested linear_matrix and linearMatrix facades take a dictionary with real and, when needed, imaginary. A conjugate transpose also reverses the sign of the imaginary component.

Operation reference

Jump to an operation

matrix_svd

Access
Registered in the Python Job
Arguments
matrix, optional options
Units
Units follow NUMERIC_API_v1 operation contract
Result
Numeric U, singular values, V and dimensions
Effect
Economy singular-value decomposition for finite real matrices
Types
matrix
Declared shape
two_dimensional
Options
nonfinite=error
Nonfinite values
error
Units rule
caller_owned
gxtxt_api_call("NUMERIC_API_v1", "matrix_svd", args)
Recorded result · matrix_svd

Download the example script (ZIP).

Example operands, preview

[
  {
    "shape": [
      3,
      2
    ],
    "dtype": "float64",
    "values": [
      1.0,
      3.0,
      6.0,
      2.0,
      4.0,
      9.0
    ]
  }
]

Result, preview

{
  "u": {
    "shape": [
      3,
      2
    ],
    "dtype": "float64",
    "values": [
      -0.18297439960300474,
      -0.4120824361242281,
      -0.8925852535908495,
      0.7466119875805695,
      -0.6489199925622684,
      0.14653799252745753
    ]
  },
  "singular_values": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      12.11817591294814,
      0.38705625281538936
    ]
  },
  "v": {
    "shape": [
      2,
      2
    ],
    "dtype": "float64",
    "values": [
      -0.5590555276790508,
      -0.8291302171381152,
      -0.8291302171381152,
      0.5590555276790508
    ]
  },
  "rank": 2.0,
  "tolerance": 5.329070518200751e-15,
  "condition_number": 31.308565162821523,
  "rows": 3.0,
  "cols": 2.0
}

linear_matrix

Access
Registered in the Python Job
Arguments
action, matrix struct, optional other matrix struct, optional options struct
Units
Units follow NUMERIC_API_v1 operation contract
Result
split-complex result struct
Effect
Complex linear algebra inspection, solve, decomposition and matrix functions
Types
complex_matrix
Declared shape
two_dimensional
Options
rank_policy=error,minimum_norm;rank_tolerance=nonnegative;condition_limit=positive;exponent=integer
Nonfinite values
error
Units rule
caller_owned
gxtxt_api_call("NUMERIC_API_v1", "linear_matrix", args)
Recorded result · linear_matrix:rank-minimum-norm

Download the example script (ZIP).

Example operands, preview

[
  "solve",
  {
    "real": {
      "shape": [
        2,
        2
      ],
      "dtype": "float64",
      "values": [
        1.0,
        2.0,
        1.0,
        2.0
      ]
    },
    "imaginary": {
      "shape": [
        2,
        2
      ],
      "dtype": "float64",
      "values": [
        0.0,
        0.0,
        0.0,
        0.0
      ]
    }
  },
  {
    "real": {
      "shape": [
        2,
        1
      ],
      "dtype": "float64",
      "values": [
        2.0,
        4.0
      ]
    },
    "imaginary": {
      "shape": [
        2,
        1
      ],
      "dtype": "float64",
      "values": [
        0.0,
        0.0
      ]
    }
  },
  {
    "rank_policy": "minimum_norm"
  }
]

Result, preview

{
  "rows": 2.0,
  "cols": 2.0,
  "rank": 1.0,
  "rank_tolerance": 8.881784197001252e-16,
  "condition_number": 2.0140709820486308e+16,
  "value_real": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      0.9999999999999997,
      0.9999999999999997
    ]
  },
  "value_imaginary": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      0.0,
      0.0
    ]
  },
  "residual_real": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      -6.661338147750939e-16,
      -1.3322676295501878e-15
    ]
  },
  "residual_imaginary": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      0.0,
      0.0
    ]
  },
  "residual_norm": 1.4895204919483639e-15,
  "relative_residual": 3.3306690738754696e-16,
  "solution_kind": "minimum_norm",
  "rhs_columns": 1.0
}
Negative test or attempted call · linear_matrix:rank-error

Download the example script (ZIP).

Example operands, preview

[
  "solve",
  {
    "real": {
      "shape": [
        2,
        2
      ],
      "dtype": "float64",
      "values": [
        1.0,
        2.0,
        1.0,
        2.0
      ]
    },
    "imaginary": {
      "shape": [
        2,
        2
      ],
      "dtype": "float64",
      "values": [
        0.0,
        0.0,
        0.0,
        0.0
      ]
    }
  },
  {
    "real": {
      "shape": [
        2,
        1
      ],
      "dtype": "float64",
      "values": [
        2.0,
        4.0
      ]
    },
    "imaginary": {
      "shape": [
        2,
        1
      ],
      "dtype": "float64",
      "values": [
        0.0,
        0.0
      ]
    }
  }
]

Result, preview

"GXTXT:ScriptBridge:RemoteError: NUMERIC_API_v1/linear_matrix: math.numeric API v1: A is rank deficient; request minimum_norm explicitly"

rank_tolerance is nonnegative and defaults to max(m,n)·eps(σmax). condition_limit defaults to 10¹² for actions that check conditioning.

Matrix actions and results
  • inspect

    Use and result
    Returns rank, conditioning, the induced 1-norm and infinity norm, and the Frobenius norm. For square A, it also returns trace and determinant. It checks positive definiteness for Hermitian A.
  • transpose

    Use and result
    Swaps rows and columns while preserving the sign of the imaginary part.
  • conjugate_transpose

    Use and result
    Swaps rows and columns and conjugates every element.
  • diagonal

    Use and result
    Extracts the main diagonal.
  • diagonal_construct

    Use and result
    Builds a diagonal matrix from vector A.
  • rectangular_to_polar

    Use and result
    Returns magnitude and phase in radians, element by element.
  • polar_to_rectangular

    Use and result
    Uses the nonnegative magnitudes in A and the real phases in radians in B. The matrices must have the same shape.
  • identity

    Use and result
    Builds a rectangular identity matrix with the same shape as A.
  • multiply

    Use and result
    Returns AB. The number of columns of A must equal the number of rows of B.
  • solve

    Use and result
    Solves AX=B and returns the solution, residuals, and number of right-hand sides. rank_policy=error is the default. minimum_norm uses the pseudoinverse and allows reduced rank.
  • inverse

    Use and result
    Inverts square, full-rank A when its condition number is within condition_limit.
  • pseudoinverse

    Use and result
    Computes the generalized inverse using rank_tolerance, including for rectangular A.
  • lu

    Use and result
    Factors a square matrix into lower and upper triangular matrices and a permutation, with PA=LU.
  • qr

    Use and result
    Factors A into Q and R and reports the column permutation.
  • cholesky

    Use and result
    Returns triangular R such that RᴴR=A. A must be square, Hermitian, and positive definite.
  • svd

    Use and result
    Returns the economy-size factorization UΣVᴴ, useful for checking rank and sensitivity.
  • schur

    Use and result
    For square A, returns complex Q and T with diagnostics for the reconstruction QTQᴴ.
  • eigen

    Use and result
    Returns the eigenvectors and eigenvalues of a square matrix.
  • hermitian_eigen

    Use and result
    Solves the eigenproblem for A=Aᴴ. The kernel rejects matrices without the required symmetry.
  • generalized_eigen

    Use and result
    Solves Av=λBv. A and B must have the same square shape, and B must be nonsingular.
  • exponential

    Use and result
    Computes the matrix exponential of a square matrix.
  • logarithm

    Use and result
    Returns the matrix logarithm of nonsingular square A and the relative reconstruction residual.
  • square_root

    Use and result
    Returns a matrix square root of square A and the reconstruction residual V²−A.
  • power

    Use and result
    Raises square A to an integer power. Negative powers require invertibility and acceptable conditioning.

complexUnary

Access
Registered in the Python Job
Arguments
name realPart imaginaryPart {options {}}
Units
Exact original owner units and interpretation; no relabelling
Result
Complete original result with number/boolean/string/vector/matrix/tensor/struct/cell types from owner resultTypes immediately after call
Function
Exact original Numeric complexUnary
gxtxt_api_call("NUMERIC_API_v1", "complexUnary", args)
Recorded result · complexUnary

Download the example script (ZIP).

Example operands, preview

[
  "magnitude",
  {
    "kind": "vector",
    "value": {
      "shape": [
        4
      ],
      "dtype": "float64",
      "values": [
        1.0,
        2.0,
        3.0,
        4.0
      ]
    }
  },
  {
    "kind": "vector",
    "value": {
      "shape": [
        4
      ],
      "dtype": "float64",
      "values": [
        1.0,
        1.0,
        2.0,
        2.0
      ]
    }
  }
]

Result, preview

{
  "values": {
    "shape": [
      4,
      1
    ],
    "dtype": "float64",
    "values": [
      1.4142135623730951,
      2.23606797749979,
      3.605551275463989,
      4.47213595499958
    ]
  }
}
Negative test or attempted call · complexUnary

Download the example script (ZIP).

Example operands, preview

[
  "abs",
  {
    "kind": "vector",
    "value": {
      "shape": [
        4
      ],
      "dtype": "float64",
      "values": [
        1.0,
        2.0,
        3.0,
        4.0
      ]
    }
  },
  {
    "kind": "vector",
    "value": {
      "shape": [
        4
      ],
      "dtype": "float64",
      "values": [
        1.0,
        1.0,
        2.0,
        2.0
      ]
    }
  }
]

Result, preview

"GXTXT:ScriptBridge:RemoteError: NUMERIC_API_v1/complexUnary: math.numeric API v1: unknown complex unary operation: abs"

complexBinary

Access
Registered in the Python Job
Arguments
name realA imaginaryA realB imaginaryB {options {}}
Units
Exact original owner units and interpretation; no relabelling
Result
Complete original result with number/boolean/string/vector/matrix/tensor/struct/cell types from owner resultTypes immediately after call
Function
Exact original Numeric complexBinary
gxtxt_api_call("NUMERIC_API_v1", "complexBinary", args)
Recorded result · complexBinary

Download the example script (ZIP).

Example operands, preview

[
  "add",
  {
    "kind": "vector",
    "value": {
      "shape": [
        4
      ],
      "dtype": "float64",
      "values": [
        1.0,
        2.0,
        3.0,
        4.0
      ]
    }
  },
  {
    "kind": "vector",
    "value": {
      "shape": [
        4
      ],
      "dtype": "float64",
      "values": [
        1.0,
        1.0,
        2.0,
        2.0
      ]
    }
  },
  {
    "kind": "vector",
    "value": {
      "shape": [
        4
      ],
      "dtype": "float64",
      "values": [
        1.5,
        1.5,
        2.5,
        2.5
      ]
    }
  },
  {
    "kind": "vector",
    "value": {
      "shape": [
        4
      ],
      "dtype": "float64",
      "values": [
        1.0,
        2.0,
        3.0,
        4.0
      ]
    }
  }
]

Result, preview

{
  "real": {
    "shape": [
      4,
      1
    ],
    "dtype": "float64",
    "values": [
      2.5,
      3.5,
      5.5,
      6.5
    ]
  },
  "imaginary": {
    "shape": [
      4,
      1
    ],
    "dtype": "float64",
    "values": [
      2.0,
      3.0,
      5.0,
      6.0
    ]
  }
}
Negative test or attempted call · complexBinary

Download the example script (ZIP).

Result, preview

"GXTXT:ScriptBridge:RemoteError: NUMERIC_API_v1/complexBinary: math.numeric API v1: array operand requires kind and value"

matrixSvd

Access
Registered in the Python Job
Arguments
matrix {options {}}
Units
Exact original owner units and interpretation; no relabelling
Result
Complete original result with number/boolean/string/vector/matrix/tensor/struct/cell types from owner resultTypes immediately after call
Function
Exact original Numeric matrixSvd
gxtxt_api_call("NUMERIC_API_v1", "matrixSvd", args)
Recorded result · matrixSvd

Download the example script (ZIP).

Example operands, preview

[
  {
    "shape": [
      3,
      2
    ],
    "dtype": "float64",
    "values": [
      1.0,
      3.0,
      6.0,
      2.0,
      4.0,
      9.0
    ]
  }
]

Result, preview

{
  "u": {
    "shape": [
      3,
      2
    ],
    "dtype": "float64",
    "values": [
      -0.18297439960300474,
      -0.4120824361242281,
      -0.8925852535908495,
      0.7466119875805695,
      -0.6489199925622684,
      0.14653799252745753
    ]
  },
  "singular_values": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      12.11817591294814,
      0.38705625281538936
    ]
  },
  "v": {
    "shape": [
      2,
      2
    ],
    "dtype": "float64",
    "values": [
      -0.5590555276790508,
      -0.8291302171381152,
      -0.8291302171381152,
      0.5590555276790508
    ]
  },
  "rank": 2.0,
  "tolerance": 5.329070518200751e-15,
  "condition_number": 31.308565162821523,
  "rows": 3.0,
  "cols": 2.0
}

linearMatrix

Access
Registered in the Python Job
Arguments
action matrix {other {}} {options {}}
Units
Exact original owner units and interpretation; no relabelling
Result
Complete original result with number/boolean/string/vector/matrix/tensor/struct/cell types from owner resultTypes immediately after call
Function
Exact original Numeric linearMatrix
gxtxt_api_call("NUMERIC_API_v1", "linearMatrix", args)
Recorded result · linearMatrix:rank-minimum-norm

Download the example script (ZIP).

Example operands, preview

[
  "solve",
  {
    "real": {
      "shape": [
        2,
        2
      ],
      "dtype": "float64",
      "values": [
        1.0,
        2.0,
        1.0,
        2.0
      ]
    },
    "imaginary": {
      "shape": [
        2,
        2
      ],
      "dtype": "float64",
      "values": [
        0.0,
        0.0,
        0.0,
        0.0
      ]
    }
  },
  {
    "real": {
      "shape": [
        2,
        1
      ],
      "dtype": "float64",
      "values": [
        2.0,
        4.0
      ]
    },
    "imaginary": {
      "shape": [
        2,
        1
      ],
      "dtype": "float64",
      "values": [
        0.0,
        0.0
      ]
    }
  },
  {
    "rank_policy": "minimum_norm"
  }
]

Result, preview

{
  "rows": 2.0,
  "cols": 2.0,
  "rank": 1.0,
  "rank_tolerance": 8.881784197001252e-16,
  "condition_number": 2.0140709820486308e+16,
  "value_real": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      0.9999999999999997,
      0.9999999999999997
    ]
  },
  "value_imaginary": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      0.0,
      0.0
    ]
  },
  "residual_real": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      -6.661338147750939e-16,
      -1.3322676295501878e-15
    ]
  },
  "residual_imaginary": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      0.0,
      0.0
    ]
  },
  "residual_norm": 1.4895204919483639e-15,
  "relative_residual": 3.3306690738754696e-16,
  "solution_kind": "minimum_norm",
  "rhs_columns": 1.0
}
Negative test or attempted call · linearMatrix:rank-error

Download the example script (ZIP).

Example operands, preview

[
  "solve",
  {
    "real": {
      "shape": [
        2,
        2
      ],
      "dtype": "float64",
      "values": [
        1.0,
        2.0,
        1.0,
        2.0
      ]
    },
    "imaginary": {
      "shape": [
        2,
        2
      ],
      "dtype": "float64",
      "values": [
        0.0,
        0.0,
        0.0,
        0.0
      ]
    }
  },
  {
    "real": {
      "shape": [
        2,
        1
      ],
      "dtype": "float64",
      "values": [
        2.0,
        4.0
      ]
    },
    "imaginary": {
      "shape": [
        2,
        1
      ],
      "dtype": "float64",
      "values": [
        0.0,
        0.0
      ]
    }
  }
]

Result, preview

"GXTXT:ScriptBridge:RemoteError: NUMERIC_API_v1/linearMatrix: math.numeric API v1: A is rank deficient; request minimum_norm explicitly"

rank_tolerance is nonnegative and defaults to max(m,n)·eps(σmax). condition_limit defaults to 10¹² for actions that check conditioning.

Matrix actions and results
  • inspect

    Use and result
    Returns rank, conditioning, the induced 1-norm and infinity norm, and the Frobenius norm. For square A, it also returns trace and determinant. It checks positive definiteness for Hermitian A.
  • transpose

    Use and result
    Swaps rows and columns while preserving the sign of the imaginary part.
  • conjugate_transpose

    Use and result
    Swaps rows and columns and conjugates every element.
  • diagonal

    Use and result
    Extracts the main diagonal.
  • diagonal_construct

    Use and result
    Builds a diagonal matrix from vector A.
  • rectangular_to_polar

    Use and result
    Returns magnitude and phase in radians, element by element.
  • polar_to_rectangular

    Use and result
    Uses the nonnegative magnitudes in A and the real phases in radians in B. The matrices must have the same shape.
  • identity

    Use and result
    Builds a rectangular identity matrix with the same shape as A.
  • multiply

    Use and result
    Returns AB. The number of columns of A must equal the number of rows of B.
  • solve

    Use and result
    Solves AX=B and returns the solution, residuals, and number of right-hand sides. rank_policy=error is the default. minimum_norm uses the pseudoinverse and allows reduced rank.
  • inverse

    Use and result
    Inverts square, full-rank A when its condition number is within condition_limit.
  • pseudoinverse

    Use and result
    Computes the generalized inverse using rank_tolerance, including for rectangular A.
  • lu

    Use and result
    Factors a square matrix into lower and upper triangular matrices and a permutation, with PA=LU.
  • qr

    Use and result
    Factors A into Q and R and reports the column permutation.
  • cholesky

    Use and result
    Returns triangular R such that RᴴR=A. A must be square, Hermitian, and positive definite.
  • svd

    Use and result
    Returns the economy-size factorization UΣVᴴ, useful for checking rank and sensitivity.
  • schur

    Use and result
    For square A, returns complex Q and T with diagnostics for the reconstruction QTQᴴ.
  • eigen

    Use and result
    Returns the eigenvectors and eigenvalues of a square matrix.
  • hermitian_eigen

    Use and result
    Solves the eigenproblem for A=Aᴴ. The kernel rejects matrices without the required symmetry.
  • generalized_eigen

    Use and result
    Solves Av=λBv. A and B must have the same square shape, and B must be nonsingular.
  • exponential

    Use and result
    Computes the matrix exponential of a square matrix.
  • logarithm

    Use and result
    Returns the matrix logarithm of nonsingular square A and the relative reconstruction residual.
  • square_root

    Use and result
    Returns a matrix square root of square A and the reconstruction residual V²−A.
  • power

    Use and result
    Raises square A to an integer power. Negative powers require invertibility and acceptable conditioning.

complex_unary.conjugate

Access
Listed in the service catalog. Check the selector and whether the call matches or is rejected.
Arguments
real_part,imaginary_part
Shape
matching_parts_or_scalar
Units
preserve
Result
same_as_input
Effect
Conjugate a split-complex array
Types
scalar,vector,matrix
Declared shape
matching_parts_or_scalar
Expansion
scalar_expansion
Options
nonfinite=error,ieee
Nonfinite values
error,ieee
Units rule
preserve
gxtxt_api_call("NUMERIC_API_v1", "callOperation", ["complex_unary.conjugate", operands])
Recorded result · call:complex_unary.conjugate

Download the example script (ZIP).

Example operands, preview

[
  "complex_unary.conjugate",
  [
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.25,
        0.75
      ]
    },
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.5,
        0.25
      ]
    }
  ]
]

Result, preview

{
  "real": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      0.25,
      0.75
    ]
  },
  "imaginary": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      -0.5,
      -0.25
    ]
  }
}

complex_unary.magnitude

Access
Listed in the service catalog. Check the selector and whether the call matches or is rejected.
Arguments
real_part,imaginary_part
Shape
matching_parts_or_scalar
Units
operation_specific
Result
same_as_input
Effect
Project a split-complex array to a real array
Types
scalar,vector,matrix
Declared shape
matching_parts_or_scalar
Expansion
scalar_expansion
Options
nonfinite=error,ieee
Nonfinite values
error,ieee
Units rule
operation_specific
gxtxt_api_call("NUMERIC_API_v1", "callOperation", ["complex_unary.magnitude", operands])
Recorded result · call:complex_unary.magnitude

Download the example script (ZIP).

Example operands, preview

[
  "complex_unary.magnitude",
  [
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.25,
        0.75
      ]
    },
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.5,
        0.25
      ]
    }
  ]
]

Result, preview

{
  "values": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      0.5590169943749475,
      0.7905694150420949
    ]
  }
}

complex_unary.magnitude_squared

Access
Listed in the service catalog. Check the selector and whether the call matches or is rejected.
Arguments
real_part,imaginary_part
Shape
matching_parts_or_scalar
Units
operation_specific
Result
same_as_input
Effect
Project a split-complex array to a real array
Types
scalar,vector,matrix
Declared shape
matching_parts_or_scalar
Expansion
scalar_expansion
Options
nonfinite=error,ieee
Nonfinite values
error,ieee
Units rule
operation_specific
gxtxt_api_call("NUMERIC_API_v1", "callOperation", ["complex_unary.magnitude_squared", operands])
Recorded result · call:complex_unary.magnitude_squared

Download the example script (ZIP).

Example operands, preview

[
  "complex_unary.magnitude_squared",
  [
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.25,
        0.75
      ]
    },
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.5,
        0.25
      ]
    }
  ]
]

Result, preview

{
  "values": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      0.3125,
      0.625
    ]
  }
}

complex_unary.real

Access
Listed in the service catalog. Check the selector and whether the call matches or is rejected.
Arguments
real_part,imaginary_part
Shape
matching_parts_or_scalar
Units
operation_specific
Result
same_as_input
Effect
Project a split-complex array to a real array
Types
scalar,vector,matrix
Declared shape
matching_parts_or_scalar
Expansion
scalar_expansion
Options
nonfinite=error,ieee
Nonfinite values
error,ieee
Units rule
operation_specific
gxtxt_api_call("NUMERIC_API_v1", "callOperation", ["complex_unary.real", operands])
Recorded result · call:complex_unary.real

Download the example script (ZIP).

Example operands, preview

[
  "complex_unary.real",
  [
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.25,
        0.75
      ]
    },
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.5,
        0.25
      ]
    }
  ]
]

Result, preview

{
  "values": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      0.25,
      0.75
    ]
  }
}

complex_unary.imag

Access
Listed in the service catalog. Check the selector and whether the call matches or is rejected.
Arguments
real_part,imaginary_part
Shape
matching_parts_or_scalar
Units
operation_specific
Result
same_as_input
Effect
Project a split-complex array to a real array
Types
scalar,vector,matrix
Declared shape
matching_parts_or_scalar
Expansion
scalar_expansion
Options
nonfinite=error,ieee
Nonfinite values
error,ieee
Units rule
operation_specific
gxtxt_api_call("NUMERIC_API_v1", "callOperation", ["complex_unary.imag", operands])
Recorded result · call:complex_unary.imag

Download the example script (ZIP).

Example operands, preview

[
  "complex_unary.imag",
  [
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.25,
        0.75
      ]
    },
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.5,
        0.25
      ]
    }
  ]
]

Result, preview

{
  "values": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      0.5,
      0.25
    ]
  }
}

complex_binary.add

Access
Listed in the service catalog. Check the selector and whether the call matches or is rejected.
Arguments
real_a,imaginary_a,real_b,imaginary_b
Shape
matching_parts_and_operands
Units
operation_specific
Result
common_shape
Effect
Combine split-complex arrays elementwise
Types
scalar,vector,matrix
Declared shape
matching_parts_and_operands
Expansion
scalar_expansion
Options
nonfinite=error,ieee
Nonfinite values
error,ieee
Units rule
operation_specific
gxtxt_api_call("NUMERIC_API_v1", "callOperation", ["complex_binary.add", operands])
Recorded result · call:complex_binary.add

Download the example script (ZIP).

Example operands, preview

[
  "complex_binary.add",
  [
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.25,
        0.75
      ]
    },
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.5,
        0.25
      ]
    },
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.5,
        0.25
      ]
    },
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.25,
        0.75
      ]
    }
  ]
]

Result, preview

{
  "real": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      0.75,
      1.0
    ]
  },
  "imaginary": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      0.75,
      1.0
    ]
  }
}

complex_binary.subtract

Access
Listed in the service catalog. Check the selector and whether the call matches or is rejected.
Arguments
real_a,imaginary_a,real_b,imaginary_b
Shape
matching_parts_and_operands
Units
operation_specific
Result
common_shape
Effect
Combine split-complex arrays elementwise
Types
scalar,vector,matrix
Declared shape
matching_parts_and_operands
Expansion
scalar_expansion
Options
nonfinite=error,ieee
Nonfinite values
error,ieee
Units rule
operation_specific
gxtxt_api_call("NUMERIC_API_v1", "callOperation", ["complex_binary.subtract", operands])
Recorded result · call:complex_binary.subtract

Download the example script (ZIP).

Example operands, preview

[
  "complex_binary.subtract",
  [
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.25,
        0.75
      ]
    },
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.5,
        0.25
      ]
    },
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.5,
        0.25
      ]
    },
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.25,
        0.75
      ]
    }
  ]
]

Result, preview

{
  "real": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      -0.25,
      0.5
    ]
  },
  "imaginary": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      0.25,
      -0.5
    ]
  }
}

complex_binary.multiply

Access
Listed in the service catalog. Check the selector and whether the call matches or is rejected.
Arguments
real_a,imaginary_a,real_b,imaginary_b
Shape
matching_parts_and_operands
Units
operation_specific
Result
common_shape
Effect
Combine split-complex arrays elementwise
Types
scalar,vector,matrix
Declared shape
matching_parts_and_operands
Expansion
scalar_expansion
Options
nonfinite=error,ieee
Nonfinite values
error,ieee
Units rule
operation_specific
gxtxt_api_call("NUMERIC_API_v1", "callOperation", ["complex_binary.multiply", operands])
Recorded result · call:complex_binary.multiply

Download the example script (ZIP).

Example operands, preview

[
  "complex_binary.multiply",
  [
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.25,
        0.75
      ]
    },
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.5,
        0.25
      ]
    },
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.5,
        0.25
      ]
    },
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.25,
        0.75
      ]
    }
  ]
]

Result, preview

{
  "real": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      0.0,
      0.0
    ]
  },
  "imaginary": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      0.3125,
      0.625
    ]
  }
}

complex_binary.divide

Access
Listed in the service catalog. Check the selector and whether the call matches or is rejected.
Arguments
real_a,imaginary_a,real_b,imaginary_b
Shape
matching_parts_and_operands
Units
operation_specific
Result
common_shape
Effect
Combine split-complex arrays elementwise
Types
scalar,vector,matrix
Declared shape
matching_parts_and_operands
Expansion
scalar_expansion
Options
nonfinite=error,ieee
Nonfinite values
error,ieee
Units rule
operation_specific
gxtxt_api_call("NUMERIC_API_v1", "callOperation", ["complex_binary.divide", operands])
Recorded result · call:complex_binary.divide

Download the example script (ZIP).

Example operands, preview

[
  "complex_binary.divide",
  [
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.25,
        0.75
      ]
    },
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.5,
        0.25
      ]
    },
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.5,
        0.25
      ]
    },
    {
      "kind": "array",
      "shape": [
        2,
        1
      ],
      "real": [
        0.25,
        0.75
      ]
    }
  ]
]

Result, preview

{
  "real": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      0.8,
      0.6
    ]
  },
  "imaginary": {
    "shape": [
      2,
      1
    ],
    "dtype": "float64",
    "values": [
      0.6,
      -0.7999999999999999
    ]
  }
}