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.

ClearAll[ physicalConstants ]
physicalConstants::usage = "Lookup of: 1amu, (Subscript[m, e]), ℏ, (Subscript[k, B]), (SuperMinus[e])" ;
physicalConstants = Module[{amu, massOfElectronInGrams, hbar, kb, chargeOfElectronInCoulombs},
amu = WolframAlpha["1 amu in grams",{{"Result",1},"ComputableData"}]  ;

massOfElectronInGrams = WolframAlpha["mass of electron in grams",{{"Result",1},"ComputableData"}]  ;

chargeOfElectronInCoulombs  = WolframAlpha["charge of electron in Coulombs",{{"Result",1},"ComputableData"}] ;

hbar = (*Quantity[ "hbar" ] ;*)
WolframAlpha["hbar in erg seconds",{{"Result",1},"ComputableData"}]  ;

kb = WolframAlpha["Boltzmann constant in ergs per kelvin",{{"Result",1},"ComputableData"}] ;

{amu, massOfElectronInGrams, hbar, kb, chargeOfElectronInCoulombs}
] ;
physicalConstantLabels = { 
"1 amu", 
"(Subscript[m, e]) (mass of electron)", 
Quantity[ "hbar" ], 
"(Subscript[k, B])", 
"(SuperMinus[e])"
} ;

ClearAll[ elementData ]
elementData::usage = "{elementName, density, atomicWeight, numberOfFreeValenceElectrons}.  Types: {string,KilogramsPerCubicMeter,AtomicMassUnits, integer}" ;
elementData[ elementName_ , zE_] := { elementName, ChemicalData[ elementName , "Density" ] , ElementData[ elementName, "AtomicWeight" ], zE}
(*{ ChemicalData[ "Copper" , "Density", "Units" ] , ElementData[ "Copper", "AtomicWeight", "Units" ]}*)

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

(*{kI, cuI}*)

Calculation and display helper functions.

ClearAll[ tableOfPhysicalConstants ]
tableOfPhysicalConstants= Table[ {physicalConstantLabels[[i]], physicalConstants[[i]]},{i, Length[physicalConstants]} ] ;

ClearAll[ fermiInfo ]
fermiInfo::usage = "calculate Fermi energy, temperature, velocity" ;
fermiInfo[physicalConstants_,  eInfo_] := Module[{amu,massOfAtom,numberDensityOfFreeElectronsInAtom,kF,massOfElectronInGrams,hbar,kb,eF, tF, rho,kgPerM3ToGperCM3,gramsPerCm3, vF, elementDensityKilogramsPerCubicMeter, atomicWeightAMU, elementName, numberOfFreeValenceElectrons, chargeOfElectronInCoulombs},

{amu, massOfElectronInGrams, hbar, kb, chargeOfElectronInCoulombs} = physicalConstants ;
{elementName, elementDensityKilogramsPerCubicMeter, atomicWeightAMU, numberOfFreeValenceElectrons} = eInfo ;

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

massOfAtom = atomicWeightAMU * amu  ;

numberDensityOfFreeElectronsInAtom = numberOfFreeValenceElectrons rho / massOfAtom ;

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

eF= UnitConvert[ UnitSimplify[ hbar^2 kF^2/2 / massOfElectronInGrams  ], "Erg" ] ;

tF = eF / kb ;

vF = UnitConvert[ UnitSimplify[ hbar kF / massOfElectronInGrams ], Quantity["cm/s"] ] ;

{rho,massOfAtom,numberDensityOfFreeElectronsInAtom,kF,eF,tF, vF}
]

ClearAll[ resistivityCalculations ]
resistivityCalculations::usage = "mean free path and mean scattering time based on Fermi wave number and resistivity." ;
resistivityCalculations[fi_, physicalConstants_,resistivity_] :=Module[{rho,massOfAtom,numberDensityOfFreeElectronsInAtom,kF,eF,tF, vF, meanFreePath, meanScatteringTime},
{rho,massOfAtom,numberDensityOfFreeElectronsInAtom,kF,eF,tF, vF}= fi ;
{amu, massOfElectronInGrams, hbar, kb, chargeOfElectronInCoulombs} = physicalConstants ;

meanFreePath = 3 hbar Pi^2 /(kF^2  chargeOfElectronInCoulombs^2 resistivity )  ;
meanScatteringTime = meanFreePath / vF ;

{
{ "ρ, resistivity",resistivity },
{ "(Subscript[l, 0]) = 3 ℏ (π^2)/(((Subscript[k, F]) (SuperMinus[e]))^2 ρ), mean free path", UnitConvert[ UnitSimplify[ meanFreePath ], Quantity["cm"]] },
{ "τ = (Subscript[l, 0])/(Subscript[v, F]), mean scattering time",UnitSimplify[ meanScatteringTime ] }
}
]

ClearAll[ tableOfFermiInfo ]
tableOfFermiInfo::usage = "Take lookups and computations from fermiInfo[], and physicalConstants and display them in a table." ;
tableOfFermiInfo[fi_, eInfo_] := Module[{rho,atomicWeightAMU,massOfAtom,numberDensityOfFreeElectronsInAtom,kF,eF,tF, vF, elementDensityKilogramsPerCubicMeter,  elementName, numberOfFreeValenceElectrons},

{rho,massOfAtom,numberDensityOfFreeElectronsInAtom,kF,eF,tF, vF}= fi ;
{elementName, elementDensityKilogramsPerCubicMeter, atomicWeightAMU, numberOfFreeValenceElectrons} = eInfo ;

{
{"ElementName", elementName},
{ "(Subscript[ρ, m]), density of element", rho},
{"atomic mass", atomicWeightAMU },
{"(Subscript[Z, v]), the number of free valence electrons", numberOfFreeValenceElectrons},
{"m, the mass of 1 atom = atomic mass * 1 amu" , massOfAtom},
{"n = (Subscript[Z, v]) (Subscript[ρ, m])/ m, number density of free electrons", numberDensityOfFreeElectronsInAtom},
{"(Subscript[k, F]) = (3 (π^2) n)^((1/3))", kF},
{"(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]))", eF},
{ "(Subscript[T, F]) = (Subscript[E, F])/(Subscript[k, B])", tF},
{ "(Subscript[v, F]) = ℏ (Subscript[k, F])/(Subscript[m, e])", vF}
}
]

Do the calculations and display the results.

(*tableOfPhysicalConstants // TableForm*)

(*Clear[ kInfo ]
kInfo = fermiInfo[ physicalConstants, kI ] ;
tableOfFermiInfo[ kInfo, kI ]  // TableForm*)

Clear[ cuInfo, tCu, meanValuesCu]
cuInfo = fermiInfo[ physicalConstants, cuI ] ;
tCu = tableOfFermiInfo[ cuInfo, cuI ] ;
meanValuesCu = resistivityCalculations[cuInfo, physicalConstants,Quantity[ 1.0 10^(-8),"Ohm meter" ] ] ;
(*PrependTo[ tCu, tableOfPhysicalConstants ] ;*)
(*AppendTo[ tCu, meanValuesCu ] ;*)
Flatten[ {tableOfPhysicalConstants, tCu, meanValuesCu}, 1] // TableForm