openfermion.circuits.state_swap_eigen_component
The +/- eigen-component of the operation that swaps states x and y.
openfermion.circuits.state_swap_eigen_component(
x: str, y: str, sign: int = 1, angle: float = 0
)
For example, state_swap_eigen_component('01', '10', ±1) with angle θ returns
┌ ┐
│0, 0, 0, 0│
│0, 0.5, ±0.5 e^{-iθ}, 0│
│0, ±0.5 e^{iθ}, 0.5, 0│
│0, 0, 0, 0│
└ ┘
Args |
x
|
The first state to swap, as a bitstring.
|
y
|
The second state to swap, as a bitstring. Must have high index than
x.
|
sign
|
The sign of the off-diagonal elements (indicated by +/-1).
|
angle
|
The phase of the complex off-diagonal elements. Defaults to 0.
|
Returns: The eigen-component.
Raises |
ValueError
|
* x and y have different lengths
- x or y contains a character other than '0' and '1'
- x and y are the same
- sign is not -1 or 1
|
TypeError
|
x or y is not a string
|
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."],[],[]]