pub struct JordanWignerTransform { /* private fields */ }Expand description
Jordan-Wigner transformation for mapping fermions to qubits
Implementations§
Source§impl JordanWignerTransform
impl JordanWignerTransform
Sourcepub fn transform_operator_to_sum(
&mut self,
op: &FermionicOperator,
) -> Result<PauliOperatorSum>
pub fn transform_operator_to_sum( &mut self, op: &FermionicOperator, ) -> Result<PauliOperatorSum>
Transform a single fermionic operator to its complete Pauli operator sum via JW.
Returns the full Jordan-Wigner representation as a PauliOperatorSum (possibly
containing multiple terms for operators like creation/annihilation).
JW mappings (n = num_modes, Z_k below denotes Z on mode k):
n_i = (I − Z_i)/2→ two Pauli strings (constant + Z_i)c†_i = (Z_0⋯Z_{i-1})(X_i − iY_i)/2→ two Pauli stringsc_i = (Z_0⋯Z_{i-1})(X_i + iY_i)/2→ two Pauli stringsHopping c†_from c_tovia full product → four raw terms reduced to twoInteraction c†⋯c_lvia full product
Sourcepub fn transform_operator(
&mut self,
op: &FermionicOperator,
) -> Result<PauliString>
pub fn transform_operator( &mut self, op: &FermionicOperator, ) -> Result<PauliString>
Transform fermionic operator to a single representative Pauli string.
This returns only the X-part of the JW decomposition (for creation/annihilation)
or the Z-only part of the number operator, and is used internally for
Pauli-composition chains. For complete expectation values use
transform_operator_to_sum.
Sourcepub fn transform_string(
&mut self,
fermionic_string: &FermionicString,
) -> Result<PauliOperatorSum>
pub fn transform_string( &mut self, fermionic_string: &FermionicString, ) -> Result<PauliOperatorSum>
Transform fermionic string to Pauli operator sum.
Each fermionic operator is expanded to its complete JW Pauli representation; successive operator sums are then multiplied together (outer product). The overall fermionic coefficient is applied last.
Sourcepub fn transform_hamiltonian(
&mut self,
hamiltonian: &FermionicHamiltonian,
) -> Result<PauliOperatorSum>
pub fn transform_hamiltonian( &mut self, hamiltonian: &FermionicHamiltonian, ) -> Result<PauliOperatorSum>
Transform fermionic Hamiltonian to Pauli Hamiltonian
Auto Trait Implementations§
impl Freeze for JordanWignerTransform
impl RefUnwindSafe for JordanWignerTransform
impl Send for JordanWignerTransform
impl Sync for JordanWignerTransform
impl Unpin for JordanWignerTransform
impl UnsafeUnpin for JordanWignerTransform
impl UnwindSafe for JordanWignerTransform
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.