This notebook generalizes the notebook for ‘problem set 6, problem 1’, which had a Fermi energy/temperature calculation.

Lookup physical constants, and element/chemical data for Potassium and Copper (ps6 used Potassium, not displayed in this notebook ; ps10 problem 1 uses Copper, and provides the Copper resistivity used herein).

ClearAll[ physicalConstants ]
physicalConstants::usage = "Lookup of: 1 amu, (Subscript[m, e]), ℏ, (Subscript[k, B]), (SuperMinus[e]).  An array of two hashes, the first with values of the quantities, the second with the names of those quantities.  Hash keys are: AtomicMassUnit, MassOfElectronInGrams, Hbar, BoltzmannKb, ChargeOfElectronInCoulombs." ;
physicalConstants = {
{
"AtomicMassUnit" -> WolframAlpha["1 amu in grams",{{"Result",1},"ComputableData"}], 
"MassOfElectronInGrams" -> WolframAlpha["mass of electron in grams",{{"Result",1},"ComputableData"}], 
"Hbar" -> WolframAlpha["hbar in erg seconds",{{"Result",1},"ComputableData"}],
"BoltzmannKb" -> WolframAlpha["Boltzmann constant in ergs per kelvin",{{"Result",1},"ComputableData"}], 
"ChargeOfElectronInCoulombs" -> WolframAlpha["charge of electron in Coulombs",{{"Result",1},"ComputableData"}]
},
{ 
"AtomicMassUnit" -> "1 amu", 
"MassOfElectronInGrams" -> "(Subscript[m, e]) (mass of electron)", 
"Hbar" -> Quantity[ "hbar" ], 
"BoltzmannKb" -> "(Subscript[k, B])", 
"ChargeOfElectronInCoulombs" -> "(SuperMinus[e])"
}
} ;

ClearAll[ elementData ]
elementData::usage = "Selective Element and Chemical data.  Returns two hashes, one with values of the quantities, another with the names of those quantities.  Hash keys are: ElementName, Density (KilogramsPerCubicMeter), AtomicWeight (AtomicMassUnits), NumFreeElectrons." ;

elementData[ en_ , zE_] := { 
{ 
"ElementName" -> en,
"Density" -> ChemicalData[ en , "Density" ], 
"AtomicWeight" -> ElementData[ en, "AtomicWeight" ], 
"NumFreeElectrons" -> zE 
},
{ 
"ElementName" -> "Element name", 
"Density" -> "(Subscript[ρ, m]), Density of element" , 
"AtomicWeight" -> "Atomic mass" , 
"NumFreeElectrons" ->  "(Subscript[Z, v]), the number of free valence electrons"
}
} ;

(*Clear[ kI ]
kI = elementData[ "Potassium", 1 ] ;*)

Clear[ cuI ]
cuI = elementData[ "Copper", 1 ] ;

Calculation and display helper functions.

ClearAll[ fermiInfo ]
fermiInfo::usage = "calculate Fermi energy, temperature, velocity" ;
fermiInfo[ eInfo_ ] := Module[{massOfAtom,numberDensityOfFreeElectronsInAtom,kF,eF, tF, rho,kgPerM3ToGperCM3,gramsPerCm3, vF, v, lookupTable, valuesMap, descMap},

lookupTable = Flatten[ {physicalConstants[[1]], eInfo}, 1 ]  ;
v[vv_] := vv /. lookupTable ;

(* => kg/m^3 : *) 
kgPerM3ToGperCM3 = 1/1000 ;
gramsPerCm3 = Quantity[ "Grams" ] /Quantity[ "Centimeter" ]^3 ;
rho = v[ "Density" ]  * kgPerM3ToGperCM3  gramsPerCm3  ;

massOfAtom = v[ "AtomicWeight" ] * v[ "AtomicMassUnit" ]  ;

numberDensityOfFreeElectronsInAtom = v[ "NumFreeElectrons" ] rho / massOfAtom ;

kF = (3 Pi^2 numberDensityOfFreeElectronsInAtom)^(1/3)  ;

eF= UnitConvert[ UnitSimplify[ v["Hbar"]^2 kF^2/2 / v["MassOfElectronInGrams"]  ], "Erg" ] ;

tF = eF / v[ "BoltzmannKb" ] ;

vF = UnitConvert[ UnitSimplify[ v["Hbar"] kF / v["MassOfElectronInGrams"] ], Quantity["cm/s"] ] ;

valuesMap = {
"MassDensity" -> rho,
"MassOfOneAtom" ->  massOfAtom,
"NumberDensityOfFreeElectrons" -> numberDensityOfFreeElectronsInAtom,
"FermiWaveVector" -> kF,
"FermiEnergy" -> eF,
"FermiTemperature" -> tF,
"FermiVelocity" -> vF
} ;

descMap = {
"MassDensity" -> "(Subscript[ρ, m]), density of element",
"MassOfOneAtom" -> "m, the mass of 1 atom = atomic mass * 1 amu" ,
"NumberDensityOfFreeElectrons" ->  "n = (Subscript[Z, v]) (Subscript[ρ, m])/ m, number density of free electrons",
"FermiWaveVector" -> "(Subscript[k, F]) = (3 (π^2) n)^((1/3))",
"FermiEnergy" -> "(Subscript[E, F]) = \!\(\*TemplateBox[{SuperscriptBox["\"\\!\\(\\*SubscriptBox[\\(k\\), \\(F\\)]\\)\"", "2"]},
"QuantityUnit",
DisplayFunction->(TooltipBox[
StyleBox[
RowBox[{#, "", 
StyleBox[
RowBox[{" ", 
RowBox[{
SuperscriptBox["\"ℏ\"", "2"]}]}], "QuantityUnitTraditionalLabel"]}], ShowStringCharacters -> False], "Unit: reduced Planck constants squared"]& ),
InterpretationFunction->(RowBox[{"Quantity", "[", 
RowBox[{#, ",", 
SuperscriptBox["\"ReducedPlanckConstant\"", "2"]}], "]"}]& )]\)/(2 (Subscript[m, e]))",
"FermiTemperature" -> "(Subscript[T, F]) = (Subscript[E, F])/(Subscript[k, B])",
"FermiVelocity" -> "(Subscript[v, F]) = ℏ (Subscript[k, F])/(Subscript[m, e])"
} ;

{valuesMap, descMap}
]



ClearAll[ resistivityCalculations ]
resistivityCalculations::usage = "mean free path and mean scattering time based on Fermi wave number and resistivity." ;
resistivityCalculations[fi_, resistivity_] :=Module[{meanFreePath, meanScatteringTime, v, lookupTable, valuesMap, descMap},

lookupTable = Flatten[ {physicalConstants[[1]], fi}, 1 ]  ;
v[vv_] := vv /. lookupTable ;


meanFreePath = 3 v["Hbar"] Pi^2 /(v[ "FermiWaveVector" ]^2  v[ "ChargeOfElectronInCoulombs" ]^2 resistivity )  ;
meanScatteringTime = meanFreePath / v[ "FermiVelocity" ] ;

valuesMap = {
"Resistivity" -> resistivity,
"MeanFreePath" -> UnitConvert[ UnitSimplify[ meanFreePath ], Quantity["cm"]],
"MeanScatteringTime" -> UnitSimplify[ meanScatteringTime ]
} ;

descMap = {
"Resistivity" -> "ρ, resistivity",
"MeanFreePath" -> "(Subscript[l, 0]) = 3 ℏ (π^2)/(((Subscript[k, F]) (SuperMinus[e]))^2 ρ), mean free path" ,
"MeanScatteringTime" -> "τ = (Subscript[l, 0])/(Subscript[v, F]), mean scattering time"
} ;

{ valuesMap, descMap }
]

Do the calculations and display the results.

Module[{cuInfo, meanValuesCu, tCu, dCu},
cuInfo = fermiInfo[ cuI[[1]] ] ;
meanValuesCu = resistivityCalculations[ cuInfo[[1]], Quantity[ 1.0 10^(-8),"Ohm meter" ] ] ;

tCu = Flatten[ { physicalConstants[[1]], cuInfo[[1]], meanValuesCu[[1]] }, 1] ;
dCu = Flatten[ { physicalConstants[[2]], cuInfo[[2]], meanValuesCu[[2]] }, 1] ;
(* http://mathematica.stackexchange.com/a/3176/10 *)
tCu /.dCu /. Rule->List // TableForm
]