qr¶
- qr(x: array, /, *, mode: Literal['reduced', 'complete'] = 'reduced') Tuple[array, array]¶
- Returns the qr decomposition x = QR of a full column rank matrix (or a stack of matrices), where - Qis an orthonormal matrix (or a stack of matrices) and- Ris an upper-triangular matrix (or a stack of matrices).- Note - Whether an array library explicitly checks whether an input array is a full column rank matrix (or a stack of full column rank matrices) is implementation-defined. - Parameters:
- x (array) – input array having shape - (..., M, N)and whose innermost two dimensions form- MxNmatrices of rank- N. Should have a floating-point data type.
- mode (Literal['reduced', 'complete']) – - decomposition mode. Should be one of the following modes: - 'reduced': compute only the leading- Kcolumns of- q, such that- qand- rhave dimensions- (..., M, K)and- (..., K, N), respectively, and where- K = min(M, N).
- 'complete': compute- qand- rwith dimensions- (..., M, M)and- (..., M, N), respectively.
 - Default: - 'reduced'.
 
- Returns:
- out (Tuple[array, array]) – a namedtuple - (Q, R)whose- first element must have the field name - Qand must be an array whose shape depends on the value of- modeand contain matrices with orthonormal columns. If- modeis- 'complete', the array must have shape- (..., M, M). If- modeis- 'reduced', the array must have shape- (..., M, K), where- K = min(M, N). The first- x.ndim-2dimensions must have the same size as those of the input array- x.
- second element must have the field name - Rand must be an array whose shape depends on the value of- modeand contain upper-triangular matrices. If- modeis- 'complete', the array must have shape- (..., M, N). If- modeis- 'reduced', the array must have shape- (..., K, N), where- K = min(M, N). The first- x.ndim-2dimensions must have the same size as those of the input- x.
 - Each returned array must have a floating-point data type determined by Type Promotion Rules.