@@ -778,3 +778,86 @@ def test_without_kinds(cp2k_code, cp2k_basissets, cp2k_pseudos, clear_database):
778778
779779 _ , calc_node = run_get_node (CalculationFactory ("cp2k" ), ** inputs )
780780 assert calc_node .exit_status == 0
781+
782+
783+ def test_added_mos (cp2k_code , cp2k_basissets , cp2k_pseudos , clear_database ): # pylint: disable=unused-argument
784+ """Testing CP2K with the Basis Set stored in gaussian.basisset and a smearing section but no predefined ADDED_MOS"""
785+
786+ structure = StructureData (cell = [[4.00759 , 0.0 , 0.0 ], [- 2.003795 , 3.47067475 , 0.0 ],
787+ [3.06349683e-16 , 5.30613216e-16 , 5.00307 ]],
788+ pbc = True )
789+ structure .append_atom (position = (- 0.00002004 , 2.31379473 , 0.87543719 ), symbols = "H" )
790+ structure .append_atom (position = (2.00381504 , 1.15688001 , 4.12763281 ), symbols = "H" )
791+ structure .append_atom (position = (2.00381504 , 1.15688001 , 3.37697219 ), symbols = "H" )
792+ structure .append_atom (position = (- 0.00002004 , 2.31379473 , 1.62609781 ), symbols = "H" )
793+
794+ # parameters
795+ parameters = Dict (
796+ dict = {
797+ 'GLOBAL' : {
798+ 'RUN_TYPE' : 'ENERGY' ,
799+ },
800+ 'FORCE_EVAL' : {
801+ 'METHOD' : 'Quickstep' ,
802+ 'DFT' : {
803+ "XC" : {
804+ "XC_FUNCTIONAL" : {
805+ "_" : "PBE" ,
806+ },
807+ },
808+ "MGRID" : {
809+ "CUTOFF" : 100.0 ,
810+ "REL_CUTOFF" : 10.0 ,
811+ },
812+ "QS" : {
813+ "METHOD" : "GPW" ,
814+ "EXTRAPOLATION" : "USE_GUESS" ,
815+ },
816+ "SCF" : {
817+ "EPS_SCF" : 1e-05 ,
818+ "MAX_SCF" : 3 ,
819+ "MIXING" : {
820+ "METHOD" : "BROYDEN_MIXING" ,
821+ "ALPHA" : 0.4 ,
822+ },
823+ "SMEAR" : {
824+ "METHOD" : "FERMI_DIRAC" ,
825+ "ELECTRONIC_TEMPERATURE" : 300.0 ,
826+ },
827+ },
828+ "KPOINTS" : {
829+ "SCHEME" : "MONKHORST-PACK 2 2 1" ,
830+ "FULL_GRID" : False ,
831+ "SYMMETRY" : False ,
832+ "PARALLEL_GROUP_SIZE" : - 1 ,
833+ },
834+ },
835+ },
836+ })
837+
838+ options = {
839+ "resources" : {
840+ "num_machines" : 1 ,
841+ "num_mpiprocs_per_machine" : 1
842+ },
843+ "max_wallclock_seconds" : 1 * 3 * 60 ,
844+ }
845+
846+ inputs = {
847+ "structure" : structure ,
848+ "parameters" : parameters ,
849+ "code" : cp2k_code ,
850+ "metadata" : {
851+ "options" : options ,
852+ },
853+ "basissets" : {label : b for label , b in cp2k_basissets .items () if label == "H" },
854+ "pseudos" : {label : p for label , p in cp2k_pseudos .items () if label == "H" },
855+ }
856+
857+ _ , calc_node = run_get_node (CalculationFactory ("cp2k" ), ** inputs )
858+
859+ assert calc_node .exit_status == 0
860+
861+ # check that the ADDED_MOS keyword was added within the calculation
862+ with calc_node .open ("aiida.inp" ) as fhandle :
863+ assert any ("ADDED_MOS" in line for line in fhandle ), "ADDED_MOS not found in the generated CP2K input file"
0 commit comments