openfermion.ops.general_basis_change
Change the basis of a general interaction tensor.
openfermion.ops.general_basis_change(
general_tensor, rotation_matrix, key
)
Used in the notebooks
M'^{p_1p_2...p_n} = R^{p1}{a_1} R^{p2}{a_2} ...
R^{pn}{a_n} M^{a_1a_2...a_n} R^{pn}{a_n}^T ...
R^{p2}{a2}^T R{p1}{a_1}^T
where R is the rotation matrix, M is the general tensor, M' is the
transformed general tensor, and a_k and p_k are indices. The formula uses
the Einstein notation (implicit sum over repeated indices).
In case R is complex, the k-th R in the above formula need to be conjugated
if key has a 1 in the k-th place (meaning that the corresponding operator
is a creation operator).
Args |
general_tensor
|
A square numpy array or matrix containing information
about a general interaction tensor.
|
rotation_matrix
|
A square numpy array or matrix having dimensions of
n_qubits by n_qubits. Assumed to be unitary.
|
key
|
A tuple indicating the type of general_tensor. Assumed to be
non-empty. For example, a tensor storing coefficients of
\(a^\dagger_p a_q\) would have a key of (1, 0) whereas a tensor
storing coefficients of \(a^\dagger_p a_q a_r a^\dagger_s\)
would have a key of (1, 0, 0, 1).
|
Returns |
transformed_general_tensor
|
general_tensor in the rotated basis.
|
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."],[],[]]