11import addict
2+ import util
3+ import itertools
24
35def change_info (info_old , weight_old ):
46 info_stru = [None ] * info_old .Nst
@@ -28,4 +30,47 @@ def change_info(info_old, weight_old):
2830 info_opt .cal_T = info_old .cal_T
2931 info_opt .cal_smooth = info_old .cal_smooth
3032
31- return info_stru , info_element , info_opt
33+ return info_stru , info_element , info_opt
34+
35+ """
36+ info_stru =
37+ [{'Na': {'C': 2},
38+ 'Nb': 6,
39+ 'weight': tensor([0.1250, 0.1250, 0.1150, 0.1150, 0.0200, 0.0000])},
40+ {'Na': {'C': 2},
41+ 'Nb': 6,
42+ 'weight': tensor([0.1250, 0.1250, 0.0896, 0.0896, 0.0707, 0.0000])}]
43+
44+ info_element =
45+ {'C': {'Ecut': 200,
46+ 'Ne': 19,
47+ 'Nl': 3,
48+ 'Nu': [2, 2, 1],
49+ 'Rcut': 6,
50+ 'dr': 0.01}}
51+
52+ info_opt =
53+ {'cal_T': False,
54+ 'cal_smooth': False,
55+ 'lr': 0.01}
56+ """
57+
58+
59+ def get_info_max (info_stru , info_element ):
60+ info_max = [None ] * len (info_stru )
61+ for ist in range (len (info_stru )):
62+ Nt = info_stru [ist ].Na .keys ()
63+ info_max [ist ] = addict .Dict ()
64+ info_max [ist ].Nt = len (Nt )
65+ info_max [ist ].Na = max ((info_stru [ist ].Na [it ] for it in Nt ))
66+ info_max [ist ].Nl = max ([info_element [it ].Nl for it in Nt ])
67+ info_max [ist ].Nm = max ((util .Nm (info_element [it ].Nl - 1 ) for it in Nt ))
68+ info_max [ist ].Nu = max (itertools .chain .from_iterable ([info_element [it ].Nu for it in Nt ]))
69+ info_max [ist ].Ne = max ((info_element [it ].Ne for it in Nt ))
70+ info_max [ist ].Nb = info_stru [ist ].Nb
71+ return info_max
72+
73+ """
74+ [{'Na': 2, 'Nb': 6, 'Ne': 19, 'Nl': 3, 'Nm': 5, 'Nt': 1, 'Nu': 2},
75+ {'Na': 2, 'Nb': 6, 'Ne': 19, 'Nl': 3, 'Nm': 5, 'Nt': 1, 'Nu': 2}]
76+ """
0 commit comments