Skip to main content

period

Method of Qbit.

Overloads

NameDescription
period() -> integerReturns the number of times the qubits have to be circularly shifted to the right by one site before the obtained product state is equal to the starting product state.
period(integer shift) -> integerReturns the number of times the qubits have to be circularly shifted to the right by a number of sites equal to the provided integer before the obtained product state is equal to the starting product state.

period() -> integer

Returns the number of times the qubits have to be circularly shifted to the right by one site before the obtained product state is equal to the starting product state.

Example

Qbit("0101").period() // Returns 2
Qbit("1101").period() // Returns 4
Qbit("1111").period() // Returns 1

period(integer shift) -> integer

Returns the number of times the qubits have to be circularly shifted to the right by a number of sites equal to the provided integer before the obtained product state is equal to the starting product state.

Parameters

  • shift: The number of sites by which the product state is circularly shifted.

Example

Qbit("0101").period(2) // Returns 1
Qbit("1101").period(3) // Returns 4
Qbit("1111").period(4) // Returns 1