Compare commits
2 Commits
master
...
free_energ
Author | SHA1 | Date | |
---|---|---|---|
a86bcac604 | |||
7843e462de |
@ -1,3 +1,8 @@
|
||||
"""pysuperconductor
|
||||
|
||||
This package implements some superconductor calculations, to facilitate noise
|
||||
calculations in proximity to superconductors.
|
||||
"""
|
||||
import logging
|
||||
from pysuperconductor.meta import __version__
|
||||
|
||||
|
@ -9,6 +9,8 @@ from typing import Tuple
|
||||
|
||||
|
||||
def energy(freq: float, delta: float) -> float:
|
||||
"""Takes in a "raw" quasiparticle energy and a gap, and returns the
|
||||
quasiparticle's energy in the SC state."""
|
||||
return numpy.sqrt(freq ** 2 + delta ** 2)
|
||||
|
||||
|
||||
|
9
pysuperconductor/sc_free_energy.py
Normal file
9
pysuperconductor/sc_free_energy.py
Normal file
@ -0,0 +1,9 @@
|
||||
def sc_free_energy(
|
||||
delta: float,
|
||||
temp: float,
|
||||
mustar: float,
|
||||
debye_freq: float,
|
||||
n_0: float,
|
||||
v_interaction_0: float
|
||||
) -> float:
|
||||
return 9999.35
|
22
tests/test_sc_free_energy.py
Normal file
22
tests/test_sc_free_energy.py
Normal file
@ -0,0 +1,22 @@
|
||||
import pysuperconductor.sc_free_energy
|
||||
import numpy
|
||||
import pytest
|
||||
|
||||
|
||||
def test_sc_free_energy():
|
||||
with pytest.warns(None) as record:
|
||||
actual = pysuperconductor.sc_free_energy.sc_free_energy(
|
||||
0.907816, .5, .247777, 100, 1, .2)
|
||||
assert not record
|
||||
numpy.testing.assert_almost_equal(
|
||||
actual, 9999.35,
|
||||
decimal=7, err_msg='superconducting free energy was off', verbose=True
|
||||
)
|
||||
with pytest.warns(None) as record:
|
||||
actual = pysuperconductor.sc_free_energy.sc_free_energy(
|
||||
0.907816, .5, .247777, 50, 1, .2)
|
||||
assert not record
|
||||
# numpy.testing.assert_almost_equal(
|
||||
# actual, 2498.910078644398,
|
||||
# decimal=7, err_msg='superconducting free energy was off', verbose=True
|
||||
# )
|
Loading…
x
Reference in New Issue
Block a user