openfermion.linalg.givens_matrix_elements
Compute the matrix elements of the Givens rotation that zeroes out one of two row entries.
openfermion.linalg.givens_matrix_elements(
a, b, which='left'
)
If which='left'
then returns a matrix G such that
G * [a b]^T= [0 r]^T
otherwise, returns a matrix G such that
G * [a b]^T= [r 0]^T
where r is a complex number.
Args |
a
|
complex or float
A complex number representing the upper row entry
|
b
|
complex or float
A complex number representing the lower row entry
|
which
|
string
Either 'left' or 'right', indicating whether to
zero out the left element (first argument) or right element
(second argument). Default is left .
|
Returns |
G
|
ndarray
A 2 x 2 numpy array representing the matrix G.
The numbers in the first column of G are real.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-04-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[]]