Document feedback

Question document fragment

When a question document fragment contains a formula, it is displayed as a space.

Submission type
issue

It's a little complicated...

I'd like to ask someone.

PR

Just a small problem.

I can fix it online!

Please select the submission type

Problem type
Specifications and Common Mistakes

- Specifications and Common Mistakes:

- Misspellings or punctuation mistakes,incorrect formulas, abnormal display.

- Incorrect links, empty cells, or wrong formats.

- Chinese characters in English context.

- Minor inconsistencies between the UI and descriptions.

- Low writing fluency that does not affect understanding.

- Incorrect version numbers, including software package names and version numbers on the UI.

Usability

- Usability:

- Incorrect or missing key steps.

- Missing main function descriptions, keyword explanation, necessary prerequisites, or precautions.

- Ambiguous descriptions, unclear reference, or contradictory context.

- Unclear logic, such as missing classifications, items, and steps.

Correctness

- Correctness:

- Technical principles, function descriptions, supported platforms, parameter types, or exceptions inconsistent with that of software implementation.

- Incorrect schematic or architecture diagrams.

- Incorrect commands or command parameters.

- Incorrect code.

- Commands inconsistent with the functions.

- Wrong screenshots.

- Sample code running error, or running results inconsistent with the expectation.

Risk Warnings

- Risk Warnings:

- Lack of risk warnings for operations that may damage the system or important data.

Content Compliance

- Content Compliance:

- Contents that may violate applicable laws and regulations or geo-cultural context-sensitive words and expressions.

- Copyright infringement.

Problem description

Agree to Privacy Statement

mindspore.ops.orgqr

View Source On Gitee
mindspore.ops.orgqr(input, input2)[source]

Calculates the explicit representation of the orthogonal matrix Q returned by mindspore.ops.Geqrf.

Take the case of input without batch dimension as an example, computes the first N columns of a product of Householder matrices. Suppose input input is a matrix of size (M,N) after householder transformation. When the diagonal of input is set to 1, every colunm of lower triangular in input is denoted as wj for j for j=1,,M, this function returns the first N columns of the matrix

H1H2Hk with Hj=IMτjwjwjH

where IM is the M-dimensional identity matrix. And when w is complex, wH is the conjugate transpose, otherwise the transpose. The output matrix is the same size as the input matrix input. tau is corresponding to input2.

Parameters
  • input (Tensor) – Tensor of shape (,M,N), indicating 2D or 3D matrices, with float32, float64, complex64 and complex128 data type.

  • input2 (Tensor) – Tensor of shape (,K), where K is less than or equal to N, indicating the reflecting coefficient in Householder transformation, which have the same type as input.

Returns

Tensor, has the same shape and data type as input.

Raises
  • TypeError – If input or input2 are not Tensors.

  • TypeError – If dtype of input and input2 is not one of: float64, float32, complex64, complex128.

  • ValueError – If input and input2 have different batch size.

  • ValueError – If input.shape[-2] < input.shape[-1].

  • ValueError – If input.shape[-1] < input2.shape[-1].

  • ValueError – If rank(input) - rank(input2) != 1.

  • ValueError – If rank(input) != 2 or 3.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> import numpy as np
>>> from mindspore import Tensor, ops
>>> input = Tensor(np.array([[-114.6, 10.9, 1.1], [-0.304, 38.07, 69.38], [-0.45, -0.17, 62.]]),
... mindspore.float32)
>>> input2 = Tensor(np.array([1.55, 1.94, 0.0]), mindspore.float32)
>>> y = ops.orgqr(input, input2)
>>> print(y)
[[-0.54999995 -0.2128925   0.8137956 ]
 [ 0.47119996 -0.8752807   0.08240613]
 [ 0.69749993  0.42560163  0.57772595]]