Skip to content
Snippets Groups Projects
Commit ea6418e0 authored by Joseph Weston's avatar Joseph Weston
Browse files

remove redundant calculation of tt^+

GreenFunction already has a (private) method `_a_ttdagger_a_inv`
to calculate tt^+, there was code duplication in the implementation
of `_transmission`. Replace duplication by a call to
`_a_ttdagger_a_inv`.
parent edafc8a4
No related branches found
Tags v1.0.3
No related merge requests found
......@@ -778,14 +778,7 @@ class GreensFunction(BlockResult):
return reduce(np.dot, factors)
def _transmission(self, lead_out, lead_in):
gf = self.submatrix(lead_out, lead_in)
factors = []
for lead, gf2 in ((lead_out, gf), (lead_in, gf.conj().T)):
self_en = self.lead_info[lead]
factors.append(1j * (self_en - self_en.conj().T))
factors.append(gf2)
attdagainv = reduce(np.dot, factors)
attdagainv = self._a_ttdagger_a_inv(lead_out, lead_in)
result = np.trace(attdagainv).real
if lead_out == lead_in:
# For reflection we have to be more careful
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment