Which linear function of SciPy is used to solve triangular matrix equations?

ScipyScientific ComputingProgramming

The linear function named scipy.linalg.solve_triangular is used to solve the triangular matrix e8quation. The form of this function is as follows −

scipy.linalg.solve_triangular(a, b, trans=0, lower=False, unit_diagonal=False, overwrite_b=False, debug=None, check_finite=True)

This linear function will solve the equation ax = b for x where a is a triangular matrix.

P Parameters

Below are given the parameters of the function scipy.linalg.solve_triangular()

  • a− (M, M) array_like

    This parameter represents the triangular matrix.

  • b− (M,) or (M, N)array_like

    This parameter represents the right-hand side matrix in the equation ax = b.

  • lower− bool, optional

    By using this parameter, we will be able to use only the data that is contained in the lower triangle of triangular matrix a. The default value of this parameter is upper.

  • trans− {0, 1, 2, ‘N’, ‘T’, ‘C’}, optional

    This parameter tells the type of system to solve. Below is given the table describing about the systems −

0 or ‘N’a x = b
1 or ‘T’a^T x = b
2 or ‘C’a^H x = b
  • unit_diagonal− bool, optional

    If this parameter is set to true, the diagonal elements of the triangular matrix will be assumed 1 and not be referenced as well.

  • Overwrite_b− bool, optional

    This parameter is used to allow overwriting data in b. It may enhance the performance of matrices.

  • check_finite− bool, optional

    This parameter is used to check whether the input matrices contain only finite numbers or not. We may get some performance gain after disabling it. It may result in problems if the inputs do not contain infinites.


  • x− (M,) or (M, N) ndarray

    It returns the solution of the banded matrix equation ax = b. The shape of the output will depend on the shape of b.


  • LinAlgError

    It raises LinAlgError if the circulant matrix associated with c is near singular.

Updated on 24-Nov-2021 12:05:15