-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f5eaa9
commit c28b245
Showing
5 changed files
with
50 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,3 @@ numba==0.59.1 | |
numpy==1.26.4 | ||
scipy==1.13.0 | ||
sympy==1.12 | ||
mpmath==1.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,6 @@ numba==0.59.1 | |
numpy==1.26.4 | ||
scipy==1.13.0 | ||
sympy==1.12 | ||
mpmath==1.3.0 | ||
|
||
[test_requires] | ||
pytest = ^7.1.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,6 @@ | |
"numpy==1.26.4", | ||
"scipy==1.13.0", | ||
"sympy==1.12", | ||
"mpmath==1.3.0", | ||
] | ||
|
||
test_requires = [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import numpy as np | ||
from src.fast_wave.wavefunction_arb_prec import * | ||
|
||
def test_wavefunction_computation(): | ||
""" | ||
Tests the basic functionality of all wavefunction_arb_prec functions. | ||
""" | ||
|
||
wave_smod_ap = wavefunction_arb_prec(s_mode = True, o_dimensional = True, complex_bool = False, cache = False, cache_size = 128) | ||
wave_smmd_ap = wavefunction_arb_prec(s_mode = True, o_dimensional = False, complex_bool = False, cache = False, cache_size = 128) | ||
wave_mmod_ap = wavefunction_arb_prec(s_mode = False, o_dimensional = True, complex_bool = False, cache = False, cache_size = 128) | ||
wave_mmmd_ap = wavefunction_arb_prec(s_mode = False, o_dimensional = False, complex_bool = False, cache = False, cache_size = 128) | ||
c_wave_smod_ap = wavefunction_arb_prec(s_mode = True, o_dimensional = True, complex_bool = True, cache = False, cache_size = 128) | ||
c_wave_smmd_ap = wavefunction_arb_prec(s_mode = True, o_dimensional = False, complex_bool = True, cache = False, cache_size = 128) | ||
c_wave_mmod_ap = wavefunction_arb_prec(s_mode = False, o_dimensional = True, complex_bool = True, cache = False, cache_size = 128) | ||
c_wave_mmmd_ap = wavefunction_arb_prec(s_mode = False, o_dimensional = False, complex_bool = True, cache = False, cache_size = 128) | ||
|
||
# Testing basic functionality | ||
test_output_odsm = wave_smod_ap(2, 10.0, 20) | ||
assert isinstance(test_output_odsm, mpmath.ctx_mp_python.mpf) | ||
|
||
test_output_odmm = wave_mmod_ap(2, 10.0, 20) | ||
assert isinstance(test_output_odmm, mpmath.matrices.matrices._matrix) | ||
|
||
test_output_mdsm = wave_smmd_ap(2, np.array([10.0, 4.5]), 20) | ||
assert isinstance(test_output_mdsm, mpmath.matrices.matrices._matrix) | ||
|
||
test_output_mdmm = wave_mmmd_ap(2, np.array([10.0, 4.5]), 20) | ||
assert isinstance(test_output_mdmm, mpmath.matrices.matrices._matrix) | ||
|
||
test_output_c_odsm = c_wave_smod_ap(2, 10.0 + 0.0j, 20) | ||
assert isinstance(test_output_c_odsm, mpmath.ctx_mp_python.mpc) | ||
|
||
test_output_c_odmm = c_wave_mmod_ap(2, 10.0 + 0.0j, 20) | ||
assert isinstance(test_output_c_odmm, mpmath.matrices.matrices._matrix) | ||
|
||
test_output_c_mdsm = c_wave_smmd_ap(2, np.array([10.0 + 0.0j, 4.5 + 0.0j]), 20) | ||
assert isinstance(test_output_c_mdsm, mpmath.matrices.matrices._matrix) | ||
|
||
test_output_c_mdmm = c_wave_mmmd_ap(2, np.array([10.0 + 0.0j, 4.5 + 0.0j]), 20) | ||
assert isinstance(test_output_c_mdmm, mpmath.matrices.matrices._matrix) | ||
|
||
print("All functionality tests passed.") | ||
|