Modifying the State

int32_t danceq::internal::State::set_state(const IntType local_state, const uint64_t site_index)

Sets a specific site.

Sets the site to \(\vert \textbf{local_state}\rangle\).

Parameters:
  • local_state – New local state

  • site_index – Site to modify

Returns:

error_code

int32_t danceq::internal::State::toggle(const uint64_t site_index)

Toggles a specific qudit.

Toggles the local state at site site_index:

\[\vert \sigma_{\textbf{site_index}} \rangle \rightarrow \vert Q - 1 - \sigma_{\textbf{site_index}}\rangle\]

Parameters:

site_index – Site to toggle

Returns:

error_code

int32_t danceq::internal::State::set_range(const IntType local_state, const uint64_t start = 0, const uint64_t end = MaxSites)

Sets a whole range.

Sets all sites from start to end-1 to \(\vert \textbf{local_state}\rangle\).

Parameters:
  • local_state – New local state

  • start – Start of range

  • end – End of range

Returns:

error_code

State<MaxSites, Q, IntType, Nbits, NInt> danceq::internal::State::operator>>(const uint64_t index)

Shifts all states by index to the right.

Shifts all local qudits \(\vert \sigma_i\rangle\) by index to the right:

\[\vert \sigma_i\rangle \rightarrow \vert \sigma_{i+\textbf{index}}\rangle\]

States that are coming in from the left are set to \(\vert 0 \rangle\).

Parameters:

index – Index to shift

Returns:

Shifted state

State<MaxSites, Q, IntType, Nbits, NInt> danceq::internal::State::operator<<(const uint64_t index)

Shifts all states by index to the left.

Shifts all local qudits \(\vert \sigma_i\rangle\) by index to the left:

\[\vert \sigma_i\rangle \rightarrow \vert \sigma_{i-\textbf{index}}\rangle\]

States that are coming in from the right are set to \(\vert 0 \rangle\).

Parameters:

index – Index to shift

Returns:

Shifted state

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

Bitwise operator &.

Applies the bitwise operator & to all integers in data.

Parameters:

state_input – Input state

Returns:

Output state

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

Bitwise operator |.

Applies the bitwise operator | to all integers in data.

Parameters:

state_input – Input state

Returns:

Output state

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

Bitwise operator ~.

Applies the bitwise operator ~ to all integers in data.

Returns:

Output state