Skip to main content

Operator

Base class: Object

Base class for all quantum operators.

Derived Types

Factories

PairingSum(const ComplexSparseMatrix matrix) -> Operator

The PairingSum operator is parametrized by a sparse matrix P(i,j)P(i,j) of size L×LL \times L. Each entry P(i,j)P(i,j) for i<ji < j corresponds to the operator P(i,j)fifjP(i,j) f_i^\dagger f_j^\dagger, whilst each entry P(i,j)P(i,j) for i>ji > j corresponds to the operator P(i,j)fifjP(i,j) f_i f_j. The PairingSum operator represents the sum i<jPi,jfifj+i>jPi,jfifj\sum_{i<j}P_{i,j}f_i^{\dagger}f_j^{\dagger} + \sum_{i>j}P_{i,j}f_if_j

Parameters

  • matrix: The B matrix of the corresponding Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.

PairingSum(const ComplexMatrix matrix) -> Operator

The PairingSum operator is parametrized by a sparse matrix P(i,j)P(i,j) of size L×LL \times L. Each entry P(i,j)P(i,j) for i<ji < j corresponds to the operator P(i,j)fifjP(i,j) f_i^\dagger f_j^\dagger, whilst each entry P(i,j)P(i,j) for i>ji > j corresponds to the operator P(i,j)fifjP(i,j) f_i f_j. The PairingSum operator represents the sum i<jPi,jfifj+i>jPi,jfifj\sum_{i<j}P_{i,j}f_i^{\dagger}f_j^{\dagger} + \sum_{i>j}P_{i,j}f_if_j

Parameters

  • matrix: The B matrix of the corresponding Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.

PairingSum(const RealMatrix matrix) -> Operator

The PairingSum operator is parametrized by a sparse matrix P(i,j)P(i,j) of size L×LL \times L. Each entry P(i,j)P(i,j) for i<ji < j corresponds to the operator P(i,j)fifjP(i,j) f_i^\dagger f_j^\dagger, whilst each entry P(i,j)P(i,j) for i>ji > j corresponds to the operator P(i,j)fifjP(i,j) f_i f_j. The PairingSum operator represents the sum i<jPi,jfifj+i>jPi,jfifj\sum_{i<j}P_{i,j}f_i^{\dagger}f_j^{\dagger} + \sum_{i>j}P_{i,j}f_if_j

Parameters

  • matrix: The B matrix of the corresponding Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.

PairingSum(const Operator operator) -> Operator

The PairingSum operator is parametrized by a sparse matrix P(i,j)P(i,j) of size L×LL \times L. Each entry P(i,j)P(i,j) for i<ji < j corresponds to the operator P(i,j)fifjP(i,j) f_i^\dagger f_j^\dagger, whilst each entry P(i,j)P(i,j) for i>ji > j corresponds to the operator P(i,j)fifjP(i,j) f_i f_j. The PairingSum operator represents the sum i<jPi,jfifj+i>jPi,jfifj\sum_{i<j}P_{i,j}f_i^{\dagger}f_j^{\dagger} + \sum_{i>j}P_{i,j}f_if_j

Parameters

  • operator: A sum of fermionic operators corresponding to pairing terms.

PairingSum(const RealSparseMatrix matrix) -> Operator

The PairingSum operator is parametrized by a sparse matrix P(i,j)P(i,j) of size L×LL \times L. Each entry P(i,j)P(i,j) for i<ji < j corresponds to the operator P(i,j)fifjP(i,j) f_i^\dagger f_j^\dagger, whilst each entry P(i,j)P(i,j) for i>ji > j corresponds to the operator P(i,j)fifjP(i,j) f_i f_j. The PairingSum operator represents the sum i<jPi,jfifj+i>jPi,jfifj\sum_{i<j}P_{i,j}f_i^{\dagger}f_j^{\dagger} + \sum_{i>j}P_{i,j}f_if_j

Parameters

  • matrix: The B matrix of the corresponding Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.

PairingSum(const Operator operator, as_complex options) -> Operator

The PairingSum operator is parametrized by a sparse matrix P(i,j)P(i,j) of size L×LL \times L. Each entry P(i,j)P(i,j) for i<ji < j corresponds to the operator P(i,j)fifjP(i,j) f_i^\dagger f_j^\dagger, whilst each entry P(i,j)P(i,j) for i>ji > j corresponds to the operator P(i,j)fifjP(i,j) f_i f_j. The PairingSum operator represents the sum i<jPi,jfifj+i>jPi,jfifj\sum_{i<j}P_{i,j}f_i^{\dagger}f_j^{\dagger} + \sum_{i>j}P_{i,j}f_if_j

Parameters

  • operator: A sum of fermionic operators corresponding to pairing terms.
  • options: Options used to specify the type of the stored coefficients. Options currently include as_real and as_complex

PairingSum(const Operator operator, as_real options) -> Operator

The PairingSum operator is parametrized by a sparse matrix P(i,j)P(i,j) of size L×LL \times L. Each entry P(i,j)P(i,j) for i<ji < j corresponds to the operator P(i,j)fifjP(i,j) f_i^\dagger f_j^\dagger, whilst each entry P(i,j)P(i,j) for i>ji > j corresponds to the operator P(i,j)fifjP(i,j) f_i f_j. The PairingSum operator represents the sum i<jPi,jfifj+i>jPi,jfifj\sum_{i<j}P_{i,j}f_i^{\dagger}f_j^{\dagger} + \sum_{i>j}P_{i,j}f_if_j

Parameters

  • operator: A sum of fermionic operators corresponding to pairing terms.
  • options: Options used to specify the type of the stored coefficients. Options currently include as_real and as_complex

QuadraticSum(const Operator operator) -> Operator

The QuadraticSum operator is parametrized by a sparse matrix S(i,j)S(i,j) of size 2L×2L2L \times 2L . The operator represents the sum i,jSi,j+,fifj+Si,j,+fifj+Si,j+,+fifj+Si,j,fifj\sum_{i,j}S_{i,j}^{+,-}f_i^{\dagger}f_j + S_{i,j}^{-,+}f_if_j^{\dagger} + S_{i,j}^{+,+}f_i^{\dagger}f_j^{\dagger} + S_{i,j}^{-,-}f_if_j with S=(S+,,S+,+S,,S,+)S =\begin{pmatrix}S^{+,-}, S^{+,+} \\ S^{-,-}, S^{-,+} \end{pmatrix}

Parameters

  • operator: A sum of fermionic operators corresponding to either pairing or hopping terms.

QuadraticSum(const RealMatrix matrix) -> Operator

The QuadraticSum operator is parametrized by a sparse matrix S(i,j)S(i,j) of size 2L×2L2L \times 2L . The operator represents the sum i,jSi,j+,fifj+Si,j,+fifj+Si,j+,+fifj+Si,j,fifj\sum_{i,j}S_{i,j}^{+,-}f_i^{\dagger}f_j + S_{i,j}^{-,+}f_if_j^{\dagger} + S_{i,j}^{+,+}f_i^{\dagger}f_j^{\dagger} + S_{i,j}^{-,-}f_if_j with S=(S+,,S+,+S,,S,+)S =\begin{pmatrix}S^{+,-}, S^{+,+} \\ S^{-,-}, S^{-,+} \end{pmatrix}

Parameters

  • matrix: The Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.

QuadraticSum(const ComplexMatrix matrix) -> Operator

The QuadraticSum operator is parametrized by a sparse matrix S(i,j)S(i,j) of size 2L×2L2L \times 2L . The operator represents the sum i,jSi,j+,fifj+Si,j,+fifj+Si,j+,+fifj+Si,j,fifj\sum_{i,j}S_{i,j}^{+,-}f_i^{\dagger}f_j + S_{i,j}^{-,+}f_if_j^{\dagger} + S_{i,j}^{+,+}f_i^{\dagger}f_j^{\dagger} + S_{i,j}^{-,-}f_if_j with S=(S+,,S+,+S,,S,+)S =\begin{pmatrix}S^{+,-}, S^{+,+} \\ S^{-,-}, S^{-,+} \end{pmatrix}

Parameters

  • matrix: The Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.

QuadraticSum(const RealSparseMatrix matrix) -> Operator

The QuadraticSum operator is parametrized by a sparse matrix S(i,j)S(i,j) of size 2L×2L2L \times 2L . The operator represents the sum i,jSi,j+,fifj+Si,j,+fifj+Si,j+,+fifj+Si,j,fifj\sum_{i,j}S_{i,j}^{+,-}f_i^{\dagger}f_j + S_{i,j}^{-,+}f_if_j^{\dagger} + S_{i,j}^{+,+}f_i^{\dagger}f_j^{\dagger} + S_{i,j}^{-,-}f_if_j with S=(S+,,S+,+S,,S,+)S =\begin{pmatrix}S^{+,-}, S^{+,+} \\ S^{-,-}, S^{-,+} \end{pmatrix}

Parameters

  • matrix: The Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.

QuadraticSum(const ComplexSparseMatrix matrix) -> Operator

The QuadraticSum operator is parametrized by a sparse matrix S(i,j)S(i,j) of size 2L×2L2L \times 2L . The operator represents the sum i,jSi,j+,fifj+Si,j,+fifj+Si,j+,+fifj+Si,j,fifj\sum_{i,j}S_{i,j}^{+,-}f_i^{\dagger}f_j + S_{i,j}^{-,+}f_if_j^{\dagger} + S_{i,j}^{+,+}f_i^{\dagger}f_j^{\dagger} + S_{i,j}^{-,-}f_if_j with S=(S+,,S+,+S,,S,+)S =\begin{pmatrix}S^{+,-}, S^{+,+} \\ S^{-,-}, S^{-,+} \end{pmatrix}

Parameters

  • matrix: The Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.

QuadraticSum(const Operator operator, as_real options) -> Operator

The QuadraticSum operator is parametrized by a sparse matrix S(i,j)S(i,j) of size 2L×2L2L \times 2L . The operator represents the sum i,jSi,j+,fifj+Si,j,+fifj+Si,j+,+fifj+Si,j,fifj\sum_{i,j}S_{i,j}^{+,-}f_i^{\dagger}f_j + S_{i,j}^{-,+}f_if_j^{\dagger} + S_{i,j}^{+,+}f_i^{\dagger}f_j^{\dagger} + S_{i,j}^{-,-}f_if_j with S=(S+,,S+,+S,,S,+)S =\begin{pmatrix}S^{+,-}, S^{+,+} \\ S^{-,-}, S^{-,+} \end{pmatrix}

Parameters

  • operator: A sum of fermionic operators corresponding to either pairing or hopping terms.
  • options: Options used to specify the type of the stored coefficients. Options currently include as_real and as_complex

QuadraticSum(const Operator operator, as_complex options) -> Operator

The QuadraticSum operator is parametrized by a sparse matrix S(i,j)S(i,j) of size 2L×2L2L \times 2L . The operator represents the sum i,jSi,j+,fifj+Si,j,+fifj+Si,j+,+fifj+Si,j,fifj\sum_{i,j}S_{i,j}^{+,-}f_i^{\dagger}f_j + S_{i,j}^{-,+}f_if_j^{\dagger} + S_{i,j}^{+,+}f_i^{\dagger}f_j^{\dagger} + S_{i,j}^{-,-}f_if_j with S=(S+,,S+,+S,,S,+)S =\begin{pmatrix}S^{+,-}, S^{+,+} \\ S^{-,-}, S^{-,+} \end{pmatrix}

Parameters

  • operator: A sum of fermionic operators corresponding to either pairing or hopping terms.
  • options: Options used to specify the type of the stored coefficients. Options currently include as_real and as_complex

TransferSum(const RealSparseMatrix matrix) -> Operator

The TransferSum operator is parametrized by a sparse matrix A(i,j) A(i,j) of size L×LL \times L. Each entry A(i,j) A(i,j) corresponds to the operator A(i,j)fifjA(i,j) f_i^\dagger f_j. The TransferSum operator represents the sum i,jAi,jfifj\sum_{i,j}A_{i,j}f_i^{\dagger}f_j.

Parameters

  • matrix: The A matrix of the corresponding Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.

TransferSum(const Operator operator) -> Operator

The TransferSum operator is parametrized by a sparse matrix A(i,j) A(i,j) of size L×LL \times L. Each entry A(i,j) A(i,j) corresponds to the operator A(i,j)fifjA(i,j) f_i^\dagger f_j. The TransferSum operator represents the sum i,jAi,jfifj\sum_{i,j}A_{i,j}f_i^{\dagger}f_j.

Parameters

  • operator: A sum of fermionic operators corresponding to hopping terms.

TransferSum(const RealMatrix matrix) -> Operator

The TransferSum operator is parametrized by a sparse matrix A(i,j) A(i,j) of size L×LL \times L. Each entry A(i,j) A(i,j) corresponds to the operator A(i,j)fifjA(i,j) f_i^\dagger f_j. The TransferSum operator represents the sum i,jAi,jfifj\sum_{i,j}A_{i,j}f_i^{\dagger}f_j.

Parameters

  • matrix: The A matrix of the corresponding Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.

TransferSum(const ComplexMatrix matrix) -> Operator

The TransferSum operator is parametrized by a sparse matrix A(i,j) A(i,j) of size L×LL \times L. Each entry A(i,j) A(i,j) corresponds to the operator A(i,j)fifjA(i,j) f_i^\dagger f_j. The TransferSum operator represents the sum i,jAi,jfifj\sum_{i,j}A_{i,j}f_i^{\dagger}f_j.

Parameters

  • matrix: The A matrix of the corresponding Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.

TransferSum(const ComplexSparseMatrix matrix) -> Operator

The TransferSum operator is parametrized by a sparse matrix A(i,j) A(i,j) of size L×LL \times L. Each entry A(i,j) A(i,j) corresponds to the operator A(i,j)fifjA(i,j) f_i^\dagger f_j. The TransferSum operator represents the sum i,jAi,jfifj\sum_{i,j}A_{i,j}f_i^{\dagger}f_j.

Parameters

  • matrix: The A matrix of the corresponding Bogoliubov-de-Gennes matrix of a quadratic fermionic Hamiltonian.

TransferSum(const Operator operator, as_complex options) -> Operator

The TransferSum operator is parametrized by a sparse matrix A(i,j) A(i,j) of size L×LL \times L. Each entry A(i,j) A(i,j) corresponds to the operator A(i,j)fifjA(i,j) f_i^\dagger f_j. The TransferSum operator represents the sum i,jAi,jfifj\sum_{i,j}A_{i,j}f_i^{\dagger}f_j.

Parameters

  • operator: A sum of fermionic operators corresponding to hopping terms.
  • options: Options used to specify the type of the stored coefficients. Options currently include as_real and as_complex

TransferSum(const Operator operator, as_real options) -> Operator

The TransferSum operator is parametrized by a sparse matrix A(i,j) A(i,j) of size L×LL \times L. Each entry A(i,j) A(i,j) corresponds to the operator A(i,j)fifjA(i,j) f_i^\dagger f_j. The TransferSum operator represents the sum i,jAi,jfifj\sum_{i,j}A_{i,j}f_i^{\dagger}f_j.

Parameters

  • operator: A sum of fermionic operators corresponding to hopping terms.
  • options: Options used to specify the type of the stored coefficients. Options currently include as_real and as_complex

operator_free(const ComplexMatrix matrix) -> Operator

Generates an operator that represents the hopping terms of the input matrix.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • matrix: The matrix representation of the free operator.

operator_free(const ComplexSparseMatrix matrix) -> Operator

Generates an operator that represents the hopping terms of the input matrix.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • matrix: The matrix representation of the free operator.

operator_free(const Operator operator) -> Operator

Generates an operator that represents the hopping terms of the input operator.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • operator: The operator representing a sum of hopping terms.

operator_free(const RealMatrix matrix) -> Operator

Generates an operator that represents the hopping terms of the input matrix.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • matrix: The matrix representation of the free operator.

operator_free(const RealSparseMatrix matrix) -> Operator

Generates an operator that represents the hopping terms of the input matrix.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • matrix: The matrix representation of the free operator.

operator_free(const RealSparseMatrix matrix, as_complex options) -> Operator

Generates an operator that represents the hopping terms of the input matrix.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • matrix: The matrix representation of the single-particle operator.
  • options: A set of options used to specify the single particle operator type.

operator_free(const RealSparseMatrix matrix, const StateInfo options) -> Operator

Generates an operator that represents the hopping terms of the input matrix.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • matrix: The matrix representation of the single-particle operator.
  • options: A set of options used to specify the single particle operator type.

operator_free(const ComplexMatrix matrix, as_real options) -> Operator

Generates an operator that represents the hopping terms of the input matrix.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • matrix: The matrix representation of the single-particle operator.
  • options: A set of options used to specify the single particle operator type.

operator_free(const RealMatrix matrix, as_real options) -> Operator

Generates an operator that represents the hopping terms of the input matrix.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • matrix: The matrix representation of the single-particle operator.
  • options: A set of options used to specify the single particle operator type.

operator_free(const RealMatrix matrix, as_complex options) -> Operator

Generates an operator that represents the hopping terms of the input matrix.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • matrix: The matrix representation of the single-particle operator.
  • options: A set of options used to specify the single particle operator type.

operator_free(const Operator operator_sum, const StateInfo options) -> Operator

Generates an operator that represents the hopping terms of the input operator.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • operator_sum: The operator sum.
  • options: A set of options used to dispatch the appropriate operator.

operator_free(const Operator operator_sum, as_real options) -> Operator

Generates an operator that represents the hopping terms of the input operator.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • operator_sum: The operator sum.
  • options: A set of options used to dispatch the appropriate operator.

operator_free(const ComplexMatrix matrix, const StateInfo options) -> Operator

Generates an operator that represents the hopping terms of the input matrix.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • matrix: The matrix representation of the single-particle operator.
  • options: A set of options used to specify the single particle operator type.

operator_free(const RealSparseMatrix matrix, as_real options) -> Operator

Generates an operator that represents the hopping terms of the input matrix.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • matrix: The matrix representation of the single-particle operator.
  • options: A set of options used to specify the single particle operator type.

operator_free(const RealMatrix matrix, const StateInfo options) -> Operator

Generates an operator that represents the hopping terms of the input matrix.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • matrix: The matrix representation of the single-particle operator.
  • options: A set of options used to specify the single particle operator type.

operator_free(const Operator operator_sum, as_complex options) -> Operator

Generates an operator that represents the hopping terms of the input operator.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • operator_sum: The operator sum.
  • options: A set of options used to dispatch the appropriate operator.

operator_free(const ComplexSparseMatrix matrix, const StateInfo options) -> Operator

Generates an operator that represents the hopping terms of the input matrix.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • matrix: The matrix representation of the single-particle operator.
  • options: A set of options used to specify the single particle operator type.

operator_free(const ComplexSparseMatrix matrix, as_real options) -> Operator

Generates an operator that represents the hopping terms of the input matrix.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • matrix: The matrix representation of the single-particle operator.
  • options: A set of options used to specify the single particle operator type.

operator_free(const ComplexSparseMatrix matrix, as_complex options) -> Operator

Generates an operator that represents the hopping terms of the input matrix.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • matrix: The matrix representation of the single-particle operator.
  • options: A set of options used to specify the single particle operator type.

operator_free(const ComplexMatrix matrix, as_complex options) -> Operator

Generates an operator that represents the hopping terms of the input matrix.

Unless specified otherwise, using the factory operator_free on an operator will default to complex. Valid options include (as_real, as_complex, unspecified) | (as_fermion, unspecified) | (as_singleparticle, unspecified) | (as_sparse, unspecified) and will default to (as_complex | as_fermion | as_singleparticle | as_sparse) respectively. When used on a matrix, the scalar field defaults to that of the provided matrix unless specified otherwise.

Parameters

  • matrix: The matrix representation of the single-particle operator.
  • options: A set of options used to specify the single particle operator type.

operator_stencil(const Model model) -> Operator

Converts a model to a free fermion stencil operator.

Parameters

  • model: The model to convert to a free fermion stencil operator.

Example

var my_model = model(lattice("square", [4,4]))
my_model.add(coefficient("J", 1.0))
my_model.add(neighbourhood_rule("nn_x", [1,0]))
my_model.add(neighbourhood_rule("nn_y", [0,1]))
my_model.add(interaction("J", [Create, Destroy], "nn_x"))
my_model.add(interaction("J", [Create, Destroy], "nn_y"))
var stencil = operator_stencil(my_model)

operator_stencil(const Map options) -> Operator

Generates a stencil operator.

A free stencil represents an operator of the form sn=0Nαnfsfs+δn\sum_{s}\sum_{n=0}^N \alpha_{n}f_{s}^{\dagger}f_{s + \delta_n} where δn\delta_n are displacement vectors, ss are lattice position vectors, the αn\alpha_n are position independent coefficients and NN is the number of such coefficients.To construct a stencil, the above parameters must be passed explicitly, together with information about the lattice dimensions and the boundary conditions.

Parameters

  • options: An option map to specify the parameters of the stencil.

Example

var stencil_vectors = [[-1,0],[1,0],[0,1],[0,-1]] //[[delta_{0,x},delta_{0,y}],[delta_{1,x},delta_{1,y}],[delta_{2,x},delta_{2,y}],[delta_{3,x},delta_{3,y}]]
var dimensions = [50,40] // [L_x, L_y]
var stencil_values = [0.5 + 1i, 0.2 + 1i, 0.3 + 0.1i, 2i + 2] // [alpha_0, alpha_1, alpha_2, alpha_3]
var boundary_conditions = ["periodic", "open"]
var stencil = operator_stencil(["displacements":stencil_vectors,"dimensions":dimensions,"values":stencil_values,"boundary_conditions":boundary_conditions])

Symbols

NameDescription
!=Compares two Operator objects for inequality. Returns true if the operators differ in type or internal structure.
*Multiplies an operator by integer scalar.
*=Multiplies an operator by integer scalar, modifying the operator in place.
+Adds two operators together. Returns a generic Operator for basic additions, ComplexOperatorSum when explicitly working with complex coefficients.
-Subtracts one operator from another. Returns a generic Operator for basic subtractions, ComplexOperatorSum when explicitly working with complex coefficients.
/Divides an operator by real scalar.
/=Divides an operator by complex scalar, modifying the operator in place.
=Assigns an Operator expression, replacing any existing content.
==Compares two operators for equality.Two operators are equal if they are the same type and have identical parameters.Note that mathematically equivalent expressions may not be considered equal
>>In-place Operator-vector product operator.

Members

NameDescription
adjointedReturns the adjoint of the given operator.
expvalComputes the expectation value of an Operator in a given complex state. Calculates <ψ\psi|O|ψ\psi>.
is_hermitianReturns true if the operator is Hermitian (self-adjoint). Conservative method: May return false for operators that are actually Hermitian. When true is returned, it is guaranteed to be correct.
is_realReturns true if the operator has a real matrix representation. Conservative method: May return false for operators that are actually real. When true is returned, it is guaranteed to be correct.
is_unitaryReturns true if the operator is unitary. Conservative method: May return false for operators that are actually unitary. When true is returned, it is guaranteed to be correct.
normComputes the spectral norm (largest singular value) of the operator. Can be called using either function call syntax norm(op) or method call syntax op.norm().
supportReturns the support of the operator (the set of qubits it acts on) .Current limitation: This version only supports OperatorProduct and single operators. OperatorSum support may not work correctly in this version.