File Coverage

blib/lib/HackaMol/Roles/QmMolRole.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package HackaMol::Roles::QmMolRole;
2             $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     12   6293 use Moose::Role;
  12         32  
  12         95  
6              
7             with 'HackaMol::Roles::QmAtomRole';
8              
9             has 'multiplicity', is => 'rw', isa => 'Int', lazy => 1, default => 1;
10              
11             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             default => sub { [] },
31             handles => {
32             "push_$_" => 'push',
33             "get_$_" => 'get',
34             "all_$_" => 'elements',
35             "clear_$_" => 'clear',
36             "count_$_" => 'count',
37             },
38             lazy => 1,
39             ) foreach @tscl;
40              
41             has "$_" => (
42             traits => ['Array'],
43             is => 'ro',
44             isa => 'ArrayRef[Math::Vector::Real]',
45             default => sub { [] },
46             handles => {
47             "push_$_" => 'push',
48             "get_$_" => 'get',
49             "all_$_" => 'elements',
50             "clear_$_" => 'clear',
51             "count_$_" => 'count',
52             },
53             lazy => 1,
54             ) for qw(qm_dipole frequencies eigvec alpha beta);
55              
56 12     12   64282 no Moose::Role;
  12         27  
  12         66  
57              
58             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