Skip to content

Commit

Permalink
Merge pull request #79 from RQC-HU/remove-only-moltra-option
Browse files Browse the repository at this point in the history
Remove only moltra option
  • Loading branch information
kohei-noda-qcrg authored Jan 21, 2024
2 parents a1a97c8 + c906ca8 commit 24c1ae5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 31 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# sum_dirac_dfcoef : SUMMARIZE DIRAC DFCOEF COEFFICIENTS

[![sum_dirac_dfcoef_test](https://github.com/kohei-noda-qcrg/sum_dirac_dfcoef/actions/workflows/test.yml/badge.svg)](https://github.com/kohei-noda-qcrg/sum_dirac_dfcoef/actions/workflows/test.yml)
[![sum_dirac_dfcoef_test](https://github.com/RQC-HU/sum_dirac_dfcoef/actions/workflows/test.yml/badge.svg)](https://github.com/RQC-HU/sum_dirac_dfcoef/actions/workflows/test.yml)

This program provides a utility to summarize the contribution of each atomic orbital per molecular orbital from the [DIRAC](http://diracprogram.org/doku.php) output file that the [*PRIVEC and .VECPRI options](http://www.diracprogram.org/doc/release-22/manual/analyze/privec.html) are used.

Expand Down Expand Up @@ -133,54 +133,54 @@ optional arguments (--input is required)

- -o OUTPUT, --output OUTPUT

Output file name. Default: sum_dirac_dfcoef.out
Output file name.
Default: sum_dirac_dfcoef.out

- -g, --for-generator

Automatically set the arguments for dcaspt2_input_generator.
This option is useful when you want to use the result of this program as input to dcaspt2_input_generator.
Automatically set the arguments for dcaspt2_input_generator.
This option is useful when you want to use the result of this program as input to dcaspt2_input_generator.
This option is equivalent to set -c/--compress and not set -p/--positronic and --no-scf options.

- -j [PARALLEL], --parallel [PARALLEL]

Number of parallel processes.
Default: 1 (single process).
Number of parallel processes.
Default: 1 (single process).
If you set -j option without argument, the number of parallel processes is set to the number of CPU cores(=os.cpu_count()).

- -c, --compress

Compress output. Display all coefficients on one line for each MO.
This options is useful when you want to use the result in a spreadsheet like Microsoft Excel.

- --only-moltra

Print only MOs that is included in the range of MOLTRA. You should activate this option when you want to get compressed output (-c/--compress option) but you don't want to get the output that is not included in the range of MOLTRA.

- -t THRESHOLD, --threshold THRESHOLD

threshold. Default: 0.1 %
(e.g) --threshold=0.1 => print orbital with more than 0.1 % contribution
(e.g) --threshold=0.1 print orbital with more than 0.1 % contribution

- -d DECIMAL, --decimal DECIMAL

Set the decimal places. Default: 5
(e.g) --decimal=3 => print orbital with 3 decimal places (0.123, 2.456, ...). range: 1-15
Set the decimal places.
Default: 5
(e.g) --decimal=3 → print orbital with 3 decimal places (0.123, 2.456, ...).
range: 1-15

- -a, --all-write

Print all MOs(Positronic and Electronic).

- -p, --positronic-write

Print only Positronic MOs. The output with this option cannot be used as input to dcaspt2_input_generator.
Print only Positronic MOs.
The output with this option cannot be used as input to dcaspt2_input_generator.

- -v, --version

Print version and exit

- --no-scf

If you don't activate .SCF keyword in your DIRAC input file, you must use this option.
If you don't activate .SCF keyword in your DIRAC input file, you must use this option.
But you cannot use the output using this option to dcaspt2_input_generator program.

- --debug
Expand Down
17 changes: 2 additions & 15 deletions src/sum_dirac_dfcoef/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,15 @@ def parse_args() -> "argparse.Namespace":
dest="compress",
)
parser.add_argument(
"--only-moltra",
action="store_true",
help="Print only MOs that is included in the range of MOLTRA. You should activate this option when you want to get compressed output (-c/--compress option)\
but you don't want to get the output that is not included in the range of MOLTRA.",
dest="only_moltra",
)
parser.add_argument(
"-t", "--threshold", type=float, default=0.1, help="threshold. Default: 0.1 %% (e.g) --threshold=0.1 => print orbital with more than 0.1 %% contribution", dest="threshold"
"-t", "--threshold", type=float, default=0.1, help="threshold. Default: 0.1 %% (e.g) --threshold=0.1 → print orbital with more than 0.1 %% contribution", dest="threshold"
)
parser.add_argument(
"-d",
"--decimal",
type=int,
default=5,
choices=range(1, 16),
help="Set the decimal places. Default: 5 (e.g) --decimal=3 => print orbital with 3 decimal places (0.123, 2.456, ...). range: 1-15",
help="Set the decimal places. Default: 5 (e.g) --decimal=3 print orbital with 3 decimal places (0.123, 2.456, ...). range: 1-15",
dest="decimal",
)
parser.add_argument("-a", "--all-write", action="store_true", help="Print all MOs(Positronic and Electronic).", dest="all_write")
Expand Down Expand Up @@ -110,15 +103,9 @@ def parse_args() -> "argparse.Namespace":
if not (args.no_scf or args.positronic_write) and args.compress:
args.for_generator = True

if args.only_moltra and args.for_generator:
parser.error("--only-moltra option cannot be used with --for-generator option.\nUse either --only-moltra or --for-generator option.")

if args.all_write and args.positronic_write:
parser.error("-a/--all-write and -p/--positronic-write options cannot be set at the same time.")

if args.only_moltra and not args.compress:
print("Warning: --only-moltra option is activated but --compress option is not activated. --only-moltra option will be ignored.")

return args


Expand Down
2 changes: 1 addition & 1 deletion src/sum_dirac_dfcoef/privec_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def check_start_vector_print(self, words: List[str]) -> bool:
return False

def check_end_vector_print(self, words: List[str]) -> bool:
# https://github.com/kohei-noda-qcrg/summarize_dirac_dfcoef_coefficients/issues/7#issuecomment-1377969626
# https://github.com/RQC-HU/sum_dirac_dfcoef/issues/7#issuecomment-1377969626
if len(words) >= 2 and self.stage == STAGE.WAIT_END_READING_COEF:
return True
return False
Expand Down

0 comments on commit 24c1ae5

Please sign in to comment.