![]() |
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
|
|
TypeError
|
x or y is not a string |