Skip to main content

[]

Overloads

NameDescription
(ComplexMatrix lhs [] const Fbit fbit) -> complexArray access operator with Fbit states.
(ComplexMatrix lhs [] const Qbit qbit) -> complexArray access operator with qubit product states.
(ComplexMatrix lhs [] const List<Fbit> states) -> complexArray access operator with fermionic states.
(ComplexMatrix lhs [] const List<Qbit> states) -> complexArray access operator with qubit product states.
(RealMatrix lhs [] const Fbit fbit) -> realArray access operator with Fbit states.
(RealMatrix lhs [] const Qbit qbit) -> realArray access operator with qubit product states.
(RealMatrix lhs [] const List<Fbit> states) -> realArray access operator with fermionic states.
(RealMatrix lhs [] const List<Qbit> states) -> realArray access operator with qubit product states.
(const PauliStringSum sum [] const PauliString rhs) -> complexReturns the coefficient of the input PauliString in the PauliStringSum.

(ComplexMatrix lhs [] const Fbit fbit) -> complex

Array access operator with Fbit states.

Parameters

  • fbit: A Fbit object whose integer representation is used to access a vector element.

Example

var vec = vector([0,1,2,3])
vec[Fbit("01")] // Returns 2 (equivalent to vec[2])

(ComplexMatrix lhs [] const Qbit qbit) -> complex

Array access operator with qubit product states.

Parameters

  • qbit: A Qbit object whose integer representation is used to access a vector element.

Example

var vec = vector([0,1,2,3])
vec[Qbit("01")] // Returns 2 (equivalent to vec[2])

(ComplexMatrix lhs [] const List<Fbit> states) -> complex

Array access operator with fermionic states.

Parameters

  • states: Vector of Fbit objects whose integer representation is used to access a matrix element.

Example

var mat = matrix([[0,1,2],[3,4,5],[6,7,8]])
mat[[Fbit("00"), Fbit("01")]] // Returns 6 (equivalent to mat[0,2])

(ComplexMatrix lhs [] const List<Qbit> states) -> complex

Array access operator with qubit product states.

Parameters

  • states: A vector of Qbit objects whose integer representation is used to access a matrix element.

Example

var mat = matrix([[0,1,2],[3,4,5],[6,7,8]])
mat[[Qbit("00"), Qbit("01")]] // Returns 6 + 0i (equivalent to mat[0,2])

(RealMatrix lhs [] const Fbit fbit) -> real

Array access operator with Fbit states.

Parameters

  • fbit: A Fbit object whose integer representation is used to access a vector element.

Example

var vec = vector([0,1,2,3])
vec[Fbit("01")] // Returns 2 (equivalent to vec[2])

(RealMatrix lhs [] const Qbit qbit) -> real

Array access operator with qubit product states.

Parameters

  • qbit: A Qbit object whose integer representation is used to access a vector element.

Example

var vec = vector([0,1,2,3])
vec[Qbit("01")] // Returns 2 (equivalent to vec[2])

(RealMatrix lhs [] const List<Fbit> states) -> real

Array access operator with fermionic states.

Parameters

  • states: Vector of Fbit objects whose integer representation is used to access a matrix element.

Example

var mat = matrix([[0,1,2],[3,4,5],[6,7,8]])
mat[[Fbit("00"), Fbit("01")]] // Returns 6 (equivalent to mat[0,2])

(RealMatrix lhs [] const List<Qbit> states) -> real

Array access operator with qubit product states.

Parameters

  • states: A vector of Qbit objects whose integer representation is used to access a matrix element.

Example

var mat = matrix([[0,1,2],[3,4,5],[6,7,8]])
mat[[Qbit("00"), Qbit("01")]] // Returns 6 + 0i (equivalent to mat[0,2])

(const PauliStringSum sum [] const PauliString rhs) -> complex

Returns the coefficient of the input PauliString in the PauliStringSum.

Parameters

Returns

The coefficient of term in sum. If the term does not exist then the return value is 0.0