| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| material:qmodel [2025/08/01 09:04] – [Methods] markus | material:qmodel [2025/08/02 14:25] (current) – [Methods] markus |
|---|
| ===== Basis class ===== | ===== Basis class ===== |
| |
| | A basis is subscriptable, meaning that ''b[i]'' returns the //i//th element of the basis as a ''Vector'' (where ''i'' starts with 0). |
| ==== Properties ==== | ==== Properties ==== |
| |
| |
| Example: Let ''lb'' be a ''LatticeBasis'' and ''X'' a vector on a many-particle basis that includes particles on the lattice (possibly with additional degrees-of-freedom). Then ''X.trace(lb)'' gives the density on the lattice. | Example: Let ''lb'' be a ''LatticeBasis'' and ''X'' a vector on a many-particle basis that includes particles on the lattice (possibly with additional degrees-of-freedom). Then ''X.trace(lb)'' gives the density on the lattice. |
| | </WRAP> |
| | |
| | ''**Vector.tensor(X: Vector, [tensor_basis: Basis]) -> Vector**'' |
| | <WRAP indent> |
| | Computes the tensor product with another vector. |
| | |
| | ''tensor_basis'' is an optional argument to fix a 2-particle basis for the returned vector. If it is not given, a new basis is constructed as a tensor product of the vectors' bases. It might be necessary to specify ''tensor_basis'' in many cases, since the new vector should be defined on a particular basis object. More importantly, the symmetry of the provided basis is also respected. If ''tensor_basis'' is symmetric, the tensor product is a symmetrized tensor product, $v\otimes w+w\otimes v$, if it is antisymmetric, the tensor product is a wedge product, $v\wedge w=v\otimes w-w\otimes v$. |
| | </WRAP> |
| | |
| | ''**Vector.proj() -> Operator**'' |
| | <WRAP indent> |
| | Returns an operator that is the projector on the given vector. |
| | The vector is always normalized in the procedure. |
| </WRAP> | </WRAP> |
| ===== Operator class ===== | ===== Operator class ===== |
| </WRAP> | </WRAP> |
| |
| ''**Operator.expval(vec: Vector, [check_real: bool], [transform_real: bool]) -> float|complex**'' | ''**Operator.expval(vec: Vector, [check_real: bool], [transform_real: bool]) -> Number**'' |
| <WRAP indent> | <WRAP indent> |
| Return the expectation value of the operator w.r.t. the given vector. | Return the expectation value of the operator w.r.t. the given vector. |
| ''**Operator.norm() -> float**'' | ''**Operator.norm() -> float**'' |
| <WRAP indent> | <WRAP indent> |
| Return the 2-norm (largest singular value) of an operator. | Return the 2-norm (largest singular value) of the operator. |
| | </WRAP> |
| | |
| | ''**Operator.trace() -> complex**'' |
| | <WRAP indent> |
| | Return the trace (sum over all diagonal values) of the operator. |
| </WRAP> | </WRAP> |
| |
| Tensor product of the operator with another one. If the argument is an ''OperatorList'' then the tensor product is taken with every operator in the list and an ''OperatorList'' is returned. | Tensor product of the operator with another one. If the argument is an ''OperatorList'' then the tensor product is taken with every operator in the list and an ''OperatorList'' is returned. |
| |
| ''tensor_basis'' is an optional argument to fix a basis for the returned operator. If it is not given, a new basis is constructed as a tensor product itself. It might be necessary to specify ''tensor_basis'' in many cases, since the new operator should be defined on a particular basis object. | ''tensor_basis'' is an optional argument to fix a basis for the returned operator. If it is not given, a new basis is constructed as a tensor product itself. It might be necessary to specify ''tensor_basis'' in many cases, since the new operator should be defined on a particular basis object. Note that this cannot be a (anti)symmetric tensor basis. |
| | |
| //This does not work for symmetric/antisymmetric tensor products.// | |
| </WRAP> | </WRAP> |
| ===== OperatorList class ===== | ===== OperatorList class ===== |
| </WRAP> | </WRAP> |
| |
| ''**OperatorList.expval(vec: Vector, [check_real: bool], [transform_real: bool]) -> float|complex**'' | ''**OperatorList.expval(vec: Vector, [check_real: bool], [transform_real: bool]) -> Number**'' |
| <WRAP indent> | <WRAP indent> |
| Return the expectation values of each operator in the list w.r.t. the given vector as a NumPy ''ndarray''. Flags are like in ''Operator.expval()''. | Return the expectation values of each operator in the list w.r.t. the given vector as a NumPy ''ndarray''. Flags are like in ''Operator.expval()''. |
| <WRAP indent> | <WRAP indent> |
| Tensor product of each operator in the list with another operator that returns an ''OperatorList''. The optional argument ''tensor_basis'' is like for ''Operator.tensor()''. | Tensor product of each operator in the list with another operator that returns an ''OperatorList''. The optional argument ''tensor_basis'' is like for ''Operator.tensor()''. |
| |
| //This does not work for symmetric/antisymmetric tensor products.// | |
| </WRAP> | </WRAP> |