View source on GitHub |
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│ └ ┘
Returns: The eigen-component.
Raises | |
---|---|
ValueError
|
|
TypeError
|
x or y is not a string |