Hi all, It was pointed out to me by Qingtian Zhang that the file that I posted cannot actually be opened. There was some odd binary cruft at the bottom. The non-mangled file is attached.
Happy kwanting, Joe
# -*- coding: utf-8 -*-
import numpy as np
sigma_z = np.array([[1, 0], [0, -1]])
def spin_conductance(G, lead_out, lead_in, sigma=sigma_z):
"""Calculate the spin conductance between two leads.
Parameters
----------
G : an instance of `kwant.solvers.common.GreensFunction`
The Greens function of the system as returned by
`kwant.greens_function`.
lead_out : integer
The lead where spin current is collected
lead_in : integer
The lead where spin current is injected
sigma : `numpy.ndarray` of shape (2, 2)
The Pauli matrix of the quantization axis along
which to measure the spin current
Notes
-----
Calculates the spin conductance between two leads
p and q according to:
G_{pq} = Tr[ σ_{α} Γ_{q} G_{qp} Γ_{p} G^+_{qp} ]
Where Γ_{q} is the coupling matrix to lead q ( = i[Σ - Σ^+] )
and G_{qp} is the submatrix of the system's Greens function
between sites interfacing with lead p and q.
"""
ttdagger = G._a_ttdagger_a_inv(lead_out, lead_in)
sigma_z_matrix = numpy.kron(np.eye(attdagger.shape[0]//2), sigma)
return np.trace(sigma_z_matrix.dot(ttdagger)).real
signature.asc
Description: Digital signature
