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