mirror of
https://github.com/LCPQ/quantum_package
synced 2024-08-26 14:31:44 +02:00
qp_find_pi_space -apply
This commit is contained in:
parent
142a2d25fa
commit
25f7e47ef1
@ -2,7 +2,7 @@ open Core
|
|||||||
open Qputils
|
open Qputils
|
||||||
open Qptypes
|
open Qptypes
|
||||||
|
|
||||||
let run ?(sym="None") ezfio_filename =
|
let run ?(sym="None") apply ezfio_filename =
|
||||||
Ezfio.set_file ezfio_filename ;
|
Ezfio.set_file ezfio_filename ;
|
||||||
|
|
||||||
let aos =
|
let aos =
|
||||||
@ -72,8 +72,26 @@ let run ?(sym="None") ezfio_filename =
|
|||||||
| _ -> ([],[])
|
| _ -> ([],[])
|
||||||
in
|
in
|
||||||
|
|
||||||
|
begin
|
||||||
match sym with
|
match sym with
|
||||||
| "x" | "X" | "y" | "Y" | "z" | "Z" ->
|
| "x" | "X" | "y" | "Y" | "z" | "Z" ->
|
||||||
|
if apply then
|
||||||
|
begin
|
||||||
|
let ne = Ezfio.get_electrons_elec_alpha_num () in
|
||||||
|
let command =
|
||||||
|
(Printf.sprintf "qp_set_mo_class -act \"[") ^
|
||||||
|
(String.concat ~sep:"," @@ List.map ~f:string_of_int pi) ^
|
||||||
|
"]\" -core \"[" ^
|
||||||
|
(String.concat ~sep:"," @@ List.map ~f:string_of_int @@ List.filter ~f:(fun mo_i -> mo_i <= ne) sigma) ^
|
||||||
|
"]\" -del \"[" ^
|
||||||
|
(String.concat ~sep:"," @@ List.map ~f:string_of_int @@ List.filter ~f:(fun mo_i -> mo_i > ne) sigma) ^
|
||||||
|
"]\" " ^ ezfio_filename
|
||||||
|
in
|
||||||
|
print_endline command;
|
||||||
|
if Sys.command command <> 0 then
|
||||||
|
failwith "Command failed"
|
||||||
|
end
|
||||||
|
else
|
||||||
begin
|
begin
|
||||||
Printf.printf "Pi: [";
|
Printf.printf "Pi: [";
|
||||||
List.iter ~f:(fun mo_i -> Printf.printf "%d," mo_i) pi;
|
List.iter ~f:(fun mo_i -> Printf.printf "%d," mo_i) pi;
|
||||||
@ -82,6 +100,7 @@ let run ?(sym="None") ezfio_filename =
|
|||||||
Printf.printf "\b]\n"
|
Printf.printf "\b]\n"
|
||||||
end
|
end
|
||||||
| _ -> List.iter ~f:(fun (mo_i,x,y,z) -> Printf.printf "%d: (%f,%f,%f)\n" mo_i x y z) result
|
| _ -> List.iter ~f:(fun (mo_i,x,y,z) -> Printf.printf "%d: (%f,%f,%f)\n" mo_i x y z) result
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -90,10 +109,14 @@ let run ?(sym="None") ezfio_filename =
|
|||||||
let spec =
|
let spec =
|
||||||
let open Command.Spec in
|
let open Command.Spec in
|
||||||
empty
|
empty
|
||||||
+> flag "sym" (optional string) ~doc:"{x,y,z} Axis perpendicular to the plane"
|
+> flag "sym" (optional string)
|
||||||
|
~doc:"{x,y,z} Axis perpendicular to the plane"
|
||||||
|
+> flag "apply" no_arg
|
||||||
|
~doc:"Set the pi space as the active space, all other MOs frozen"
|
||||||
+> anon ("ezfio_filename" %: string)
|
+> anon ("ezfio_filename" %: string)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let command =
|
let command =
|
||||||
Command.basic_spec
|
Command.basic_spec
|
||||||
~summary: "Quantum Package command"
|
~summary: "Quantum Package command"
|
||||||
@ -101,7 +124,7 @@ let command =
|
|||||||
"Find all the pi molecular orbitals to create a pi space.
|
"Find all the pi molecular orbitals to create a pi space.
|
||||||
")
|
")
|
||||||
spec
|
spec
|
||||||
(fun sym ezfio_filename () -> run ?sym ezfio_filename )
|
(fun sym apply ezfio_filename () -> run ?sym apply ezfio_filename)
|
||||||
|
|
||||||
|
|
||||||
let () =
|
let () =
|
||||||
|
Loading…
Reference in New Issue
Block a user