Commit 9cde9545 authored by Genevieve Fleury's avatar Genevieve Fleury
Browse files

Modifications in the doc lines of operator/energy.pyx

parent 6f537782
Pipeline #26594 failed with stages
in 11 minutes and 48 seconds
......@@ -98,7 +98,7 @@ class SiteValidation:
Returns
-------
is_valid : :py:class:`bool`
Wether the site is valid of a divergence calculation.
Whether the site is valid of a divergence calculation.
"""
self._validate_site_type(site)
return self._get_site_id(site) not in self.interface_site_and_neighbors_ids
......@@ -119,7 +119,7 @@ class SiteValidation:
Returns
-------
is_valid : :py:class:`bool`
Wether the site is valid for a density calculation.
Whether the site is valid for a density calculation.
"""
self._validate_site_type(site)
......@@ -139,7 +139,7 @@ class SiteValidation:
Returns
-------
is_valid : :py:class:`bool`
Wether the hopping is valid for an energy current calculation.
Whether the hopping is valid for an energy current calculation.
"""
normalized_hop = kwant.operator._normalize_hopping_where(self.syst, [hopping])[0]
......@@ -182,7 +182,7 @@ cdef class Current:
instance and ``params`` is a :py:class:`dict` containing the parameters
values (including the current time). The method must return a matrix-like
object (e.g. a `~tinyarray` instance) of the right dimensions at each site
(the same as the onsite hamiltonian). It is saved in the `customOnsite`
(the same as the onsite Hamiltonian). It is saved in the `customOnsite`
attribute of this class.
sum : :py:class:`bool`
......@@ -198,26 +198,26 @@ cdef class Current:
(from site :math:`i` to site :math:`j`) writes:
.. math::
I_{ji}^E(t) = \sum_{\text{lead } α} \; \sum_{{\text{mode } m_α}} \frac{{\text{d}ε}}{h} f_α(ε) \sum_{k} - \text{Im} \left [ \left [ ψ_k^{m_α ε} \right ]^\dagger ε_{ki} ε_{ij} ψ_j^{m_α ε} - \left [ ψ_k^{m_α ε} \right ]^\dagger ε_{kj} ε_{ji} ψ_i^{m_α ε} \right ]
I_{ji}^E(t) = \sum_{\text{lead } α} \; \sum_{{\text{mode } m_α}} \int \frac{{\text{d}ε}}{h} f_α(ε) \sum_{k} - \text{Im} \left [ \left [ ψ_k^{m_α ε} \right ]^\dagger ε_{ki} ε_{ij} ψ_j^{m_α ε} - \left [ ψ_k^{m_α ε} \right ]^\dagger ε_{kj} ε_{ji} ψ_i^{m_α ε} \right ]
Where the written products are matrix products (where each dimension describes an orbital).
:math:`ε` is derived from the system's hamiltonian:
:math:`ε` is the energy operator derived from the system's Hamiltonian:
* Its values on hoppings coincide with the hamiltonian
* Its values on hoppings coincide with the Hamiltonian
:math:`\forall i \! \neq \! j \; ε_{ij}(t) = H_{ij}(t)`
* Its value on sites depends on what the user choses for ``baseOperator``:
* Its value on sites depends on what the user chooses for ``baseOperator``:
* ``Hamiltonian``: :math:`\forall i \, \forall t \; ~ ε_{ii}(t) = H_{ii}(t)`
* ``Kinetic+``: :math:`\forall i \, \forall t \; ~ ε_{ii}(t) = H_{ii}(t_0 - 1)` where
:math:`t_0` is the instant at which the hamiltonian starts being time-dependent,
:math:`t_0` is the instant at which the Hamiltonian starts being time-dependent,
given by `time_start` (the :math:`-1` has been added to avoid use-case problems
with heaviside-like time-dependence).
* ``Custom``: :math:`\forall i \, \forall t \; ~ ε_{ii}(t) = V_{i}(t)` where
:math:`V` is given by the user through ``customOnsite``.
The index :math:`k` runs formally over all sites in the whole system,
but effectively only the neighbors of :math:`i` and :math:`j` give a non
zero result.
but effectively only the sites connected to :math:`i` and :math:`j` (including :math:`i` and :math:`j`)
give a non zero result.
Attributes
----------
......@@ -230,7 +230,7 @@ cdef class Current:
operatorType : :py:class:`int`
Translation to an integer of the ``baseOperator`` parameter of the class
constructor: "hamiltonian" :math:`\leftrightarrow 0`,
constructor: "Hamiltonian" :math:`\leftrightarrow 0`,
"kinetic+" :math:`\leftrightarrow 1` and "custom" :math:`\leftrightarrow 2`.
syst : `~kwant.system.FiniteSystem`
......@@ -245,7 +245,7 @@ cdef class Current:
The name the time parameter has in the ``params`` dictionary given to `__call__`.
time_start : :py:class:`float`
The instant :math:`t_0` at which time dependence starts in the hamiltonian.
The instant :math:`t_0` at which time dependence starts in the Hamiltonian.
Initialized to tKwant's default value.
where : 2D array of `~kwant.graph.defs.gint` (a python :py:class:`int` compatible type) of shape :math:`n \times 2`
......@@ -441,8 +441,7 @@ cdef class Current:
cdef class Source:
r"""
An operator for calculating the local input power on sites. It gives the
energy that is given by the time dependence to the particles on each site.
An operator for calculating the local input power on sites.
"""
@cython.embedsignature
......@@ -473,7 +472,7 @@ cdef class Source:
instance and ``params`` is a :py:class:`dict` containing the parameters
values (including the current time). The method must return a matrix-like
object (e.g. a `~tinyarray` instance) of the right dimensions at each site
(the same as the onsite hamiltonian). It is saved in the `customOnsite`
(the same as the onsite Hamiltonian). It is saved in the `customOnsite`
attribute of this class.
sum : :py:class:`bool`
......@@ -489,55 +488,55 @@ cdef class Source:
containing the parameters values (including the current time).
The method must return a matrix-like object (e.g. a `tinyarray`
instance) of the right dimensions at each site (the same as the
onsite hamiltonian). If not specified (thus
onsite Hamiltonian). If not specified (thus
defaulting to :py:const:`None`), finite difference will be used
to estimate the time derivative using the "small" time step `dt`.
dt_hamiltonian : :py:const:`None` (default) or (`~kwant.builder.Site`, `~kwant.builder.Site`, :py:class:`dict`) :math:`\rightarrow` complex matrix-like object
The time derivative of the hamiltonian. Saved in the `dt_hamiltonian`
The time derivative of the Hamiltonian. Saved in the `dt_hamiltonian`
attribute of this class. If specified, its signature
should be ``dt_hamiltonian(site1, site2, params)`` where ``site1`` and
``site2`` are `~kwant.builder.Site` instances ; ``params`` is a :py:class:`dict`
containing the parameters values (including the current time). The method
must return a matrix-like object (e.g. a `tinyarray` instance) of the right
dimensions for each hopping ``(site1, site2)`` (the same size as the
hamiltonian). If not specified (thus defaulting to :py:const:`None`),
Hamiltonian). If not specified (thus defaulting to :py:const:`None`),
finite difference will be used to estimate it using the "small" time step `dt`.
dt : :py:class:`float`, default value: :math:`10^{-3}`
The step used to estimate the time derivative of the custom onsite
or the hamiltonian, if not user specified. It is saved in
or the Hamiltonian, if not user specified. It is saved in
the `dt` attribute of this class.
Notes
-----
This class calculates the energy given to the system by the time
dependent potentials to the particles at each site :math:`i`
This class calculates the power source term due to the time
dependent potentials at each site :math:`i`
given in the `where` list. At a given time :math:`t`, the power given to particles
at site :math:`i` writes:
.. math::
S_i^E(t) = \sum_{\text{lead } α} \; \sum_{{\text{mode } m_α}} \frac{{\text{d}ε}}{h} f_α(E) \sum_{k} - \text{Im} \left [ \left [ ψ_i^{m_α ε} \right ]^\dagger V'_i ε_{ik} ψ_k^{m_α ε} + \left [ ψ_k^{m_α ε} \right ]^\dagger V'_k ε_{ki} ψ_i^{m_α ε} \right ] + \text{Re} \left [ \left [ ψ_i^{m_α ε} \right ]^\dagger ∂_t ε_{ik} ψ_k^{m_α ε} \right ]
S_i^E(t) = \sum_{\text{lead } α} \; \sum_{{\text{mode } m_α}} \int \frac{{\text{d}ε}}{h} f_α(E) \sum_{k} - \text{Im} \left [ \left [ ψ_i^{m_α ε} \right ]^\dagger V'_i ε_{ik} ψ_k^{m_α ε} + \left [ ψ_k^{m_α ε} \right ]^\dagger V'_k ε_{ki} ψ_i^{m_α ε} \right ] + \text{Re} \left [ \left [ ψ_i^{m_α ε} \right ]^\dagger ∂_t ε_{ik} ψ_k^{m_α ε} \right ]
Where the written products are matrix products (where each dimension describes an orbital).
:math:`ε` is derived from the system's hamiltonian:
:math:`ε` is the energy operator derived from the system's Hamiltonian:
* Its values on hoppings coincide with the hamiltonian
:math:`\forall i \! \neq \! j \; ε_{ij}(t) = H_{ij}(t)`
* Its value on sites depends on what the user choses for ``baseOperator``:
* Its value on sites depends on what the user chooses for ``baseOperator``:
* ``Hamiltonian``: :math:`\forall i \, \forall t \; ~ ε_{ii}(t) = H_{ii}(t)`
* ``Kinetic+``: :math:`\forall i \, \forall t \; ~ ε_{ii}(t) = H_{ii}(t_0 - 1)` where
:math:`t_0` is the instant at which the hamiltonian starts being time-dependent,
:math:`t_0` is the instant at which the Hamiltonian starts being time-dependent,
given by `time_start` (the :math:`-1` has been added to avoid use-case problems
with heaviside-like time-dependence).
* ``Custom``: :math:`\forall i \, \forall t \; ~ ε_{ii}(t) = V_{i}(t)` where
:math:`V` is given by the user through ``customOnsite``.
:math:`V'` is the "time dependent part" of the Hamiltonian on sites:
:math:`V'` is defined by
:math:`V'_i(t) = H_{ii}(t) - ε_{ii}(t)`. The index :math:`k` runs formally over all sites in the whole system,
but effectively only the neighbors of :math:`i` and :math:`j` give a non
zero result.
but effectively only the sites connected to :math:`i` and :math:`j` (including :math:`i` and :math:`j`)
give a non zero result.
Attributes
----------
......@@ -550,7 +549,7 @@ cdef class Source:
operatorType : :py:class:`int`
Translation to an integer of the ``baseOperator`` parameter of the class
constructor: "hamiltonian" :math:`\leftrightarrow 0`,
constructor: "Hamiltonian" :math:`\leftrightarrow 0`,
"kinetic+" :math:`\leftrightarrow 1` and "custom" :math:`\leftrightarrow 2`.
syst : `~kwant.system.FiniteSystem`
......@@ -565,7 +564,7 @@ cdef class Source:
The name the time parameter has in the ``params`` dictionary given to `__call__`.
time_start : :py:class:`float`
The instant :math:`t_0` at which time dependence starts in the hamiltonian.
The instant :math:`t_0` at which time dependence starts in the Hamiltonian.
Initialized to tKwant's default value.
dt_customOnsite : :py:const:`None` (default) or (`~kwant.builder.Site`, :py:class:`dict`) :math:`\rightarrow` complex matrix-like object
......@@ -574,13 +573,13 @@ cdef class Source:
`operatorType` = 2.
dt_hamiltonian : :py:const:`None` (default) or (`~kwant.builder.Site`, `~kwant.builder.Site`, :py:class:`dict`) :math:`\rightarrow` complex matrix-like object
The time derivative of the hamiltonian. If it is set to ``None``,
The time derivative of the Hamiltonian. If it is set to ``None``,
finite difference will be used to estimate the time derivative
of the hamiltonian, using the "small" time step `dt`.
of the Hamiltonian, using the "small" time step `dt`.
dt : :py:class:`float`, default value: :math:`10^{-3}`
The step used to estimate the time derivative of the custom onsite
or the hamiltonian, if not user specified.
or the Hamiltonian, if not user specified.
where : 2D array of `~kwant.graph.defs.gint` (a python :py:class:`int` compatible type) of shape :math:`n \times 2`
List of sites :math:`i` (accessed as ``i = where[n, 0]``) on which the energy source is calculated at each call.
......@@ -887,26 +886,23 @@ cdef class Density:
on a site :math:`i` writes:
.. math::
ρ^E_i(t) = \sum_{\text{lead } α} \; \sum_{{\text{mode } m_α}} \frac{{\text{d}ε}}{2π} f_α(E) \sum_{j} \text{Re} \left [ \left [ ψ_k^{m_α ε} \right ]^\dagger ε_{ij} ψ_j^{m_α ε} \right ]
ρ^E_i(t) = \sum_{\text{lead } α} \; \sum_{{\text{mode } m_α}} \int \frac{{\text{d}ε}}{2π} f_α(ε) \sum_{j} \text{Re} \left [ \left [ ψ_i^{m_α ε} \right ]^\dagger ε_{ij} ψ_j^{m_α ε} \right ]
Where the written products are matrix products (where each dimension describes an orbital).
:math:`ε` is derived from the system's hamiltonian:
:math:`ε` is the energy operator derived from the system's Hamiltonian:
* Its values on hoppings coincide with the hamiltonian
* Its values on hoppings coincide with the Hamiltonian
:math:`\forall i \! \neq \! j \; ε_{ij}(t) = H_{ij}(t)`
* Its value on sites depends on what the user choses for ``baseOperator``:
* Its value on sites depends on what the user chooses for ``baseOperator``:
* ``Hamiltonian``: :math:`\forall i \, \forall t \; ~ ε_{ii}(t) = H_{ii}(t)`
* ``Kinetic+``: :math:`\forall i \, \forall t \; ~ ε_{ii}(t) = H_{ii}(t_0 - 1)` where
:math:`t_0` is the instant at which the hamiltonian starts being time-dependent,
:math:`t_0` is the instant at which the Hamiltonian starts being time-dependent,
given by `time_start` (the :math:`-1` has been added to avoid use-case problems
with heaviside-like time-dependence).
* ``Custom``: :math:`\forall i \, \forall t \; ~ ε_{ii}(t) = V_{i}(t)` where
:math:`V` is given by the user through ``customOnsite``.
The index :math:`k` runs formally over all sites in the whole system,
but effectively only the neighbors of :math:`i` and :math:`j` give a non
zero result.
Attributes
----------
......@@ -1213,7 +1209,7 @@ cdef class LeadHeatCurrent:
Central system
For each hopping :math:`(i, j)` from `hoppings` a heat current
contribution :math:`I^\text{h}_{ij}` is calculated:
contribution :math:`I^\text{H}_{ij}` is calculated:
.. math::
I_{ji}^H(t) = I^E_{ji} - S^E_i - μ I^N_{ji}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment