openfermion.hamiltonians.number_operator
Return a fermionic or bosonic number operator.
openfermion.hamiltonians.number_operator(
n_modes: int, mode: Optional[int] = None, coefficient=1.0, parity: int = -1
) -> Union[openfermion.ops.BosonOperator
, openfermion.ops.FermionOperator
]
Used in the notebooks
Args |
n_modes
|
int
The number of modes in the system.
|
mode
|
int, optional
The mode on which to return the number
operator. If None, return total number operator on all sites.
|
coefficient
|
float
The coefficient of the term.
|
parity
|
int
Returns the fermionic number operator
if parity=-1 (default),
and returns the bosonic number operator
if parity=1.
|
Returns |
operator (BosonOperator or FermionOperator)
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-04-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[]]