SpinParser  1.0
Public Member Functions | Public Attributes | List of all members
LatticeModelFactory::SpinInteraction Struct Reference

Representation of a two-spin interaction. More...

#include <LatticeModelFactory.hpp>

Collaboration diagram for LatticeModelFactory::SpinInteraction:
Collaboration graph
[legend]

Public Member Functions

 SpinInteraction ()
 Construct an uninitialized spin interaction object.
 
 SpinInteraction (const LatticeSite &from, const LatticeSite &to)
 Construct a two-spin interaction between two lattice sites and set the interaction strength to zero. More...
 
bool isConnectingFromTo (const LatticeSite &siteFrom, const LatticeSite &siteTo) const
 Determine whether the spin interaction couples two lattice sites. More...
 
int isConnectingSites (const LatticeSite &site1, const LatticeSite &site2) const
 Determine whether the spin interaction couples two lattice sites, neglecting its orientation. More...
 
SpinInteractionoperator+= (const SpinInteraction &rhs)
 Addition assignment operator. Adds the interaction strength of a second SpinInteraction object describing coupling between the same two sites. More...
 

Public Attributes

LatticeSite from
 Site from which the interaction emanates.
 
LatticeSite to
 Site to which the interaction couples.
 
float interactionStrength [3][3]
 Interaction strength, encoded as interactionStrength[s1][s2], where s1 is the x, y, or z (0, 1, or 2) component of the first spin and s2 is the component of the second spin.
 

Detailed Description

Representation of a two-spin interaction.

Constructor & Destructor Documentation

◆ SpinInteraction()

LatticeModelFactory::SpinInteraction::SpinInteraction ( const LatticeSite from,
const LatticeSite to 
)

Construct a two-spin interaction between two lattice sites and set the interaction strength to zero.

Parameters
fromFirst interaction site.
toSecond interaction site.

Member Function Documentation

◆ isConnectingFromTo()

bool LatticeModelFactory::SpinInteraction::isConnectingFromTo ( const LatticeSite siteFrom,
const LatticeSite siteTo 
) const

Determine whether the spin interaction couples two lattice sites.

Parameters
siteFromSite from which the interaction emanates.
siteToSite to which the interaction couples.
Returns
bool Returns true if the interaction couples the two lattice sites. Returns false otherwise.

◆ isConnectingSites()

int LatticeModelFactory::SpinInteraction::isConnectingSites ( const LatticeSite site1,
const LatticeSite site2 
) const

Determine whether the spin interaction couples two lattice sites, neglecting its orientation.

Parameters
site1Site from which the interaction emanates.
site2Site to which the interaction couples.
Returns
int Returns 1 if the interaction connects the two sites and the orientation matches. Returns -1 if the orientation does not match. Returns zero if the sites are not connecte by the interaction.

◆ operator+=()

SpinInteraction & LatticeModelFactory::SpinInteraction::operator+= ( const SpinInteraction rhs)

Addition assignment operator. Adds the interaction strength of a second SpinInteraction object describing coupling between the same two sites.

Parameters
rhsRight hand site operand.
Returns
SpinInteraction& Reference to self.

The documentation for this struct was generated from the following files: