HackaMol/Roles/QmMolRole.pm

filter: Statementstmt 86.6% 13 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod n/a totaltotal 78.9% 15 / 19 SCAR 0.0
CC
1
Cov
87%
__ANON__
2.0
__ANON__
2.0
BEGIN
1.0
CRAP 1.0
« HackaMol/Roles/ExeRole.pm ↑ Summary HackaMol/Bond.pm »
1 package HackaMol::Roles::QmMolRole;
2 12 $HackaMol::Roles::QmMolRole::VERSION = '0.051';
3 #ABSTRACT: provides attributes needed for quantum chemistry calculations
4 # this will need updating as needs arise
5 12 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 12 with 'HackaMol::Roles::QmAtomRole';
8  
9 12 has 'multiplicity', is => 'rw', isa => 'Int', lazy => 1, default => 1;
10  
11 12 my @tscl = qw(
12 score
13 energy
14 Etot Eelec Enuc
15 qm_dipole_moment ionization_energy gradient_norm
16 Hform
17 U H G S
18 S_t
19 S_r
20 S_v
21 Etot_mp2
22 Etot_ccsdt
23 Ecds
24 );
25  
26 has "$_" => (
27 traits => ['Array'],
28 is => 'ro',
29 isa => 'ArrayRef[Num]',
30 0 ▶ default => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
31 handles => {
32 "push_$_" => 'push',
33 "get_$_" => 'get',
34 "all_$_" => 'elements',
35 "clear_$_" => 'clear',
36 "count_$_" => 'count',
37 },
38 lazy => 1,
39 12 ) foreach @tscl;
40  
41 has "$_" => (
42 traits => ['Array'],
43 is => 'ro',
44 isa => 'ArrayRef[Math::Vector::Real]',
45 0 ▶ default => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
46 handles => {
47 "push_$_" => 'push',
48 "get_$_" => 'get',
49 "all_$_" => 'elements',
50 "clear_$_" => 'clear',
51 "count_$_" => 'count',
52 },
53 lazy => 1,
54 12 ) for qw(qm_dipole frequencies eigvec alpha beta);
55  
56 12 ▶no Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
57  
58 12 1;
59  
60 __END__
61  
62 =pod
63  
64 =head1 NAME
65  
66 HackaMol::Roles::QmMolRole - provides attributes needed for quantum chemistry calculations
67  
68 =head1 VERSION
69  
70 version 0.051
71  
72 =head1 SYNOPSIS
73  
74 # instance of class that consumes the QmMolRole.
75  
76 $obj->multiplicity(1);
77 my @energies = $mol->all_Etot;
78  
79 =head1 DESCRIPTION
80  
81 QmMolRole provides attributes that will be useful for setting up interfaces to
82 quantum chemistry packages. This role consumes the QmAtomRole so there is some
83 overlap for basis_geom, basis, and ecp. For interfaces, the Molecule should
84 take precedence over the atom; i.e. if a Molecule has a basis of 6-31G*, that
85 should be used for all atoms regardless of the basis set that they may have.
86 All attributes are 'rw' and lazy, so they will not contaminate the namespace
87 unless called upon. QmMolRole has 'basis_atoms' that should be generated from the
88 binned unique atoms in a molecule. basis_atoms are just instances of the
89 HackaMol::Atom class with all the basis sets and effective core potentials loaded,
90 either as simple strings supported by the package or the full descriptions
91 pulled from the EMSL basis set exchange as a single Str.
92 https://bse.pnl.gov/bse/portal
93  
94 A dream is to interface with EMSL library directly. Attributes below are
95 described without much detail; they will contain information mapped from
96 calculations and are not exhaustive. This role will probably evolve as
97 interfaces are added.
98  
99 =head1 ATTRIBUTES
100  
101 =head2 multiplicity
102  
103 isa Int that is lazy and rw
104  
105 =head2 Etot Eelec Enuc
106  
107 each isa ArrayRef[Num] that is lazy with public ARRAY traits: push_$_ get_$_
108 all_$_ clear_$_ count_$_
109  
110 =head2 qm_dipole_moment ionization_energy gradient_norm Hform
111  
112 each isa ArrayRef[Num] that is lazy with public ARRAY traits: push_$_ get_$_
113 all_$_ clear_$_ count_$_
114  
115 =head2 U H G S S_t S_r S_v
116  
117 each isa ArrayRef[Num] that is lazy with public ARRAY traits: push_$_ get_$_
118 all_$_ clear_$_ count_$_
119  
120 =head2 Etot_mp2 Etot_ccsdt Ecds
121  
122 each isa ArrayRef[Num] that is lazy with public ARRAY traits: push_$_ get_$_
123 all_$_ clear_$_ count_$_
124  
125 =head2 qm_dipole frequencies eigvec alpha beta
126  
127 each isa ArrayRef[Math::Vector::Real] that is lazy with public ARRAY traits: push_$_ get_$_
128 all_$_ clear_$_ count_$_
129  
130 =head1 SEE ALSO
131  
132 =over 4
133  
134 =item *
135  
136 L<HackaMol::Molecule>
137  
138 =item *
139  
140 L<EMSL | https://bse.pnl.gov/bse/portal>
141  
142 =back
143  
144 =head1 CONSUMES
145  
146 =over 4
147  
148 =item * L<HackaMol::Roles::QmAtomRole>
149  
150 =back
151  
152 =head1 AUTHOR
153  
154 Demian Riccardi <demianriccardi@gmail.com>
155  
156 =head1 COPYRIGHT AND LICENSE
157  
158 This software is copyright (c) 2017 by Demian Riccardi.
159  
160 This is free software; you can redistribute it and/or modify it under
161 the same terms as the Perl 5 programming language system itself.
162  
163 =cut
« HackaMol/Roles/ExeRole.pm ↑ Summary HackaMol/Bond.pm »