Skip to content

Commit 53975ec

Browse files
committed
update
1 parent e1ad16b commit 53975ec

File tree

5 files changed

+136
-28
lines changed

5 files changed

+136
-28
lines changed

Manifest.toml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ version = "2.3.0"
2424

2525
[[ArgTools]]
2626
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
27+
version = "1.1.1"
2728

2829
[[Arpack]]
2930
deps = ["Arpack_jll", "Libdl", "LinearAlgebra", "Logging"]
@@ -179,6 +180,7 @@ version = "3.42.0"
179180
[[CompilerSupportLibraries_jll]]
180181
deps = ["Artifacts", "Libdl"]
181182
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
183+
version = "0.5.2+0"
182184

183185
[[CompositeTypes]]
184186
git-tree-sha1 = "d5b014b216dc891e81fea299638e4c10c657b582"
@@ -283,8 +285,9 @@ uuid = "5b8099bc-c8ec-5219-889f-1d9e522a28bf"
283285
version = "0.5.9"
284286

285287
[[Downloads]]
286-
deps = ["ArgTools", "LibCURL", "NetworkOptions"]
288+
deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
287289
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
290+
version = "1.6.0"
288291

289292
[[DualNumbers]]
290293
deps = ["Calculus", "NaNMath", "SpecialFunctions"]
@@ -314,6 +317,9 @@ git-tree-sha1 = "129b104185df66e408edd6625d480b7f9e9823a0"
314317
uuid = "48062228-2e41-5def-b9a4-89aafe57970f"
315318
version = "0.9.18"
316319

320+
[[FileWatching]]
321+
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
322+
317323
[[FillArrays]]
318324
deps = ["LinearAlgebra", "Random", "SparseArrays", "Statistics"]
319325
git-tree-sha1 = "246621d23d1f43e3b9c368bf3b72b2331a27c286"
@@ -463,10 +469,12 @@ version = "0.1.6"
463469
[[LibCURL]]
464470
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
465471
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
472+
version = "0.6.3"
466473

467474
[[LibCURL_jll]]
468475
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
469476
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
477+
version = "7.84.0+0"
470478

471479
[[LibGit2]]
472480
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
@@ -475,12 +483,13 @@ uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
475483
[[LibSSH2_jll]]
476484
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
477485
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
486+
version = "1.10.2+0"
478487

479488
[[Libdl]]
480489
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
481490

482491
[[LinearAlgebra]]
483-
deps = ["Libdl"]
492+
deps = ["Libdl", "libblastrampoline_jll"]
484493
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
485494

486495
[[LogExpFunctions]]
@@ -527,6 +536,7 @@ version = "0.8.6"
527536
[[MbedTLS_jll]]
528537
deps = ["Artifacts", "Libdl"]
529538
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
539+
version = "2.28.0+0"
530540

531541
[[Metatheory]]
532542
deps = ["AutoHashEquals", "DataStructures", "Dates", "DocStringExtensions", "Parameters", "Reexport", "TermInterface", "ThreadsX", "TimerOutputs"]
@@ -551,6 +561,7 @@ uuid = "a63ad114-7e13-5084-954f-fe012c677804"
551561

552562
[[MozillaCACerts_jll]]
553563
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
564+
version = "2022.2.1"
554565

555566
[[MultivariatePolynomials]]
556567
deps = ["DataStructures", "LinearAlgebra", "MutableArithmetics"]
@@ -571,6 +582,7 @@ version = "0.3.7"
571582

572583
[[NetworkOptions]]
573584
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
585+
version = "1.2.0"
574586

575587
[[OffsetArrays]]
576588
deps = ["Adapt"]
@@ -581,10 +593,12 @@ version = "1.10.8"
581593
[[OpenBLAS_jll]]
582594
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
583595
uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"
596+
version = "0.3.20+0"
584597

585598
[[OpenLibm_jll]]
586599
deps = ["Artifacts", "Libdl"]
587600
uuid = "05823500-19ac-5b8b-9628-191a04bc5112"
601+
version = "0.8.1+0"
588602

589603
[[OpenSpecFun_jll]]
590604
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"]
@@ -618,6 +632,7 @@ version = "2.2.3"
618632
[[Pkg]]
619633
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
620634
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
635+
version = "1.8.0"
621636

622637
[[PolyesterWeave]]
623638
deps = ["BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "Static", "ThreadingUtilities"]
@@ -675,7 +690,7 @@ deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
675690
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
676691

677692
[[Random]]
678-
deps = ["Serialization"]
693+
deps = ["SHA", "Serialization"]
679694
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
680695

681696
[[RandomExtensions]]
@@ -732,6 +747,7 @@ version = "0.5.3"
732747

733748
[[SHA]]
734749
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
750+
version = "0.7.0"
735751

736752
[[SIMDDualNumbers]]
737753
deps = ["ForwardDiff", "IfElse", "SLEEFPirates", "VectorizationBase"]
@@ -853,6 +869,7 @@ version = "4.3.1"
853869
[[TOML]]
854870
deps = ["Dates"]
855871
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
872+
version = "1.0.0"
856873

857874
[[TableTraits]]
858875
deps = ["IteratorInterfaceExtensions"]
@@ -869,6 +886,7 @@ version = "1.7.0"
869886
[[Tar]]
870887
deps = ["ArgTools", "SHA"]
871888
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
889+
version = "1.10.1"
872890

873891
[[TermInterface]]
874892
git-tree-sha1 = "7aa601f12708243987b88d1b453541a75e3d8c7a"
@@ -947,17 +965,25 @@ version = "1.4.2"
947965
[[Zlib_jll]]
948966
deps = ["Libdl"]
949967
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
968+
version = "1.2.12+3"
950969

951970
[[ZygoteRules]]
952971
deps = ["MacroTools"]
953972
git-tree-sha1 = "8c1a8e4dfacb1fd631745552c8db35d0deb09ea0"
954973
uuid = "700de1a5-db45-46bc-99cf-38207098b444"
955974
version = "0.2.2"
956975

976+
[[libblastrampoline_jll]]
977+
deps = ["Artifacts", "Libdl", "OpenBLAS_jll"]
978+
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
979+
version = "5.1.1+0"
980+
957981
[[nghttp2_jll]]
958982
deps = ["Artifacts", "Libdl"]
959983
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
984+
version = "1.48.0+0"
960985

961986
[[p7zip_jll]]
962987
deps = ["Artifacts", "Libdl"]
963988
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
989+
version = "17.4.0+0"

Project.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,8 @@ Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
2020

2121
[extras]
2222
CPUSummary = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9"
23+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
24+
25+
[targets]
26+
test = ["Test"]
27+

src/Params.jl

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# ================================================================
2-
# Function params (Materials)
3-
# Materials (Materials struct) => structure materials variable
4-
# Return the kp parameters of a material from csv file.
5-
# ================================================================
6-
1+
#=
2+
===============================================================
3+
Function params (Materials)
4+
Materials (Materials struct) => structure materials variable
5+
Return the kp parameters of a material from csv file.
6+
================================================================
7+
=#
78
function params(Materials)
89
#Material,g1,g2,g3,Eg,delta,Ep,F,VBO,k,me,a,B
910
arr=["GaAs" 6.98 2.06 2.93 1.519 0.341 25.6 -1.0 -0.8 1.2 0.0675 0.565325 -0.304;
@@ -25,16 +26,18 @@ function params(Materials)
2526
nothing
2627
end
2728

28-
# ============================================================================
29-
# Function TempPar(material)
30-
# Materials (Materials struct) => structure materials variable
31-
#
32-
# obtains the Varshni parameter of respective material indicated in Materials
33-
# variable.
34-
#
35-
# return; two varables (float) with the values of the alpha and beta
36-
# ============================================================================
37-
function TempPar(material)
29+
#=
30+
===========================================================================
31+
Function TempPar(material)
32+
Materials (Materials struct) => structure materials variable
33+
34+
obtains the Varshni parameter of respective material indicated in Materials
35+
variable.
36+
37+
return; two varables (float) with the values of the alpha and beta
38+
============================================================================
39+
=#
40+
function TempPar(material)
3841
#material,alpha,beta,ap
3942
arr1=["GaAs" 5.41e-4 204 4.72e-6;
4043
"AlAs" 8.85e-4 530 2.6e-6;
@@ -50,20 +53,24 @@ function TempPar(material)
5053
return alfa, beta, alat
5154
end
5255

53-
# ====================================================================================
54-
# function aEgTemp(T,material,Eg)
55-
# T (float)=> Temperature, material (Materials struct) =>structure materials variable
56-
# Eg (float) => energy gap
57-
#
58-
# Calculates the band gap energy for the temperature (T) using the Varshni formula
59-
#
60-
# Return EgT => Energy band gap
61-
# ====================================================================================
56+
#=
57+
====================================================================================
58+
function aEgTemp(T,material,Eg)
59+
T (float)=> Temperature, material (Materials struct) =>structure materials variable
60+
Eg (float) => energy gap
61+
62+
Calculates the band gap energy for the temperature (T) using the Varshni formula
63+
64+
Return EgT => Energy band gap
65+
====================================================================================
66+
=#
6267

6368
function aEgTemp(T,material,Eg,al)
6469
mat1,mat2,comp,alloy=DetMat(material)
6570
if mat1=="HgTe"
71+
alfa, beta,alb = TempPar(mat1)
6672
EgT=-0.303
73+
alT=al+alb*(T-300)
6774
else
6875
if mat2==""
6976
alfa, beta,alb = TempPar(mat1)

test/runtests.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
using Test
2+
using KPpack
3+
4+
@testset verbose = true "KPpack tests" begin
5+
include("testParams.jl")
6+
end

test/testParams.jl

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
@testset "test reading Params " begin
2+
arr=["GaAs" 6.98;
3+
"AlAs" 3.76;
4+
"InAs" 19.7;
5+
"GaSb" 13.4;
6+
"HgTe" 4.1;
7+
"CdTe" 1.47]
8+
9+
@testset "Test bulk Material properties for: $(arr[i,1])" for i 1:size(arr)[1]
10+
T = 200
11+
12+
testparM = KPpack.Materials(arr[i,1],0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0);
13+
KPpack.params(testparM)
14+
α,β,alat = KPpack.TempPar(testparM.material)
15+
EgRef,alRef = (testparM.Eg -*T^2)/(T+β)), (testparM.al+alat*(T-300))
16+
EgTtest, alTtest = KPpack.aEgTemp(T,testparM.material,testparM.Eg,testparM.al)
17+
18+
@test testparM.g1 == arr[i,2]
19+
@test EgTtest == EgRef
20+
@test alTtest == alRef
21+
end
22+
23+
testparM = KPpack.Materials(arr[1,1],0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0);
24+
KPpack.params(testparM)
25+
@testset "Test calculus F" begin
26+
27+
S = (1/testparM.me)-(testparM.Ep*(testparM.Eg+(2/3)*testparM.delta)/(testparM.Eg*(testparM.Eg+testparM.delta)))
28+
Ftest = (S-1)/2
29+
30+
KPpack.getF(testparM,"calc")
31+
@test testparM.F == Ftest
32+
end
33+
34+
@testset "test Alloy properties" begin
35+
@testset "test the name creation" begin
36+
matAlloy = "AlGaAs_0.2"
37+
mat1Test = "AlAs"; mat2Test="GaAs"; compTest=0.2
38+
39+
mat1,mat2,comp= KPpack.DetMat(matAlloy)
40+
@test mat1==mat1Test
41+
@test mat2==mat2Test
42+
@test comp==compTest
43+
end
44+
45+
@testset "test alloy parameters" begin
46+
matAlloy = "AlGaAs_0.2"
47+
mat1Test = "AlAs"; mat2Test="GaAs"; compTest=0.2
48+
49+
T = 0; opt = "calc"
50+
@testset "test function ParMat for bulk" begin
51+
Egtest = 1.519
52+
bulkStrct = KPpack.Materials(mat2Test,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0)
53+
KPpack.ParMat(bulkStrct,T,opt)
54+
@test bulkStrct.Eg == Egtest
55+
end
56+
@testset "test function ParMat for alloy" begin
57+
Egtest = 1.7954
58+
alloyStrct = KPpack.Materials(matAlloy,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0)
59+
KPpack.ParMat(alloyStrct,T,opt)
60+
@test alloyStrct.Eg Egtest
61+
end
62+
end
63+
end
64+
end

0 commit comments

Comments
 (0)