State Comparison

Overloaded operators (greater, lesser, and equal) are defined with the integers stored in data. We further provide the same set of functions based on the qudit level within a range start to end.

bool danceq::internal::State::operator>(const State<MaxSites, Q, IntType, Nbits, NInt> &state_input) const

Compares two State instances.

Note

The comparison is done on the level of the integers stored in data and not on the qudit level.

Parameters:

state_input – State to be compared

Returns:

true if left side is greater, otherwise false

bool danceq::internal::State::operator<(const State<MaxSites, Q, IntType, Nbits, NInt> &state_input) const

Compares two State instances.

Note

The comparison is done on the level of the integers stored in data and not on the qudit level.

Parameters:

state_input – State to be compared

Returns:

true if left side is lesser, otherwise false

bool danceq::internal::State::operator==(const State<MaxSites, Q, IntType, Nbits, NInt> &state_input) const

Compares two State instances.

Note

The comparison is done on the level of the integers stored in data and not on the qudit level.

Parameters:

state_input – State to be compared

Returns:

true if both instances are equal, otherwise false

bool danceq::internal::State::greater_state_level(const State<MaxSites, Q, IntType, Nbits, NInt> &state_input, uint64_t start = 0, uint64_t end = MaxSites) const

Compares two State instances on the qudit level.

Note

The comparison is done on the qudit level and not with the integers stored in data.

Parameters:
  • state_input – State to be compared

  • start – Start of range for comparison

  • end – End of range for comparison

Returns:

true if this->State is greater, otherwise false

bool danceq::internal::State::lesser_state_level(const State<MaxSites, Q, IntType, Nbits, NInt> &state_input, uint64_t start = 0, uint64_t end = MaxSites) const

Compares two State instances on the qudit level.

Note

The comparison is done on the qudit level and not with the integers stored in data.

Parameters:
  • state_input – State to be compared

  • start – Start of range for comparison

  • end – End of range for comparison

Returns:

true if this->State is lesser, otherwise false

bool danceq::internal::State::equal_state_level(const State<MaxSites, Q, IntType, Nbits, NInt> &state_input, uint64_t start = 0, uint64_t end = MaxSites) const

Compares two State instances on the qudit level.

Note

The comparison is done on the qudit level and not with the integers stored in data.

Parameters:
  • state_input – State to be compared

  • start – Start of range for comparison

  • end – End of range for comparison

Returns:

true if both states are equal, otherwise false