1
# Handle access to Psi ccenergy module
6
# Mixin the InputGenerator
9
# Which references does this method support
10
def self.supports_analytic_gradients
11
{ "rhf" => false, "rohf" => false, "uhf" => false, "twocon" => false }
13
def self.supports_analytic_second_derivatives
14
{ "rhf" => false, "rohf" => false, "uhf" => false, "twocon" => false }
17
def initialize(task_obj)
19
# Set the generic command for this class
20
set_binary_command Psi::Commands::CCEOM
24
# Add ccenergy ability to Task
30
# Call transqt and ccsort unless told not to
32
if args_hash.has_key?(:cchbar) == false or
33
(args_hash.has_key?(:cchbar) and args_hash[:cchbar] == true)
39
args_hash.delete(:cchbar) unless args_hash == nil
41
# Create a new scf object
42
eom_obj = Psi::CCEom.new self
44
# Form the input hash and generate the input file
47
# Check to see if the function arguments have the reference, if so use it, otherwise use
49
if args_hash == nil or args_hash.has_key?("reference") == false
50
input_hash["reference"] = reference
53
# If we are doing analytic gradients make sure ccenergy knows
54
if get_gradients == true and CCEom.supports_analytic_gradients[reference] == true
55
input_hash["dertype"] = "first"
57
input_hash["dertype"] = "none"
60
# Check the wavefunction
61
if args_hash == nil or args_hash.has_key?("wfn") == false
62
input_hash["wfn"] = wavefunction
65
# Merge what we've done with what the user wants, user settings should override
66
input_hash = input_hash.merge(args_hash) unless args_hash == nil
68
# Run the ccenergy module, sending the input file as keyboard input
70
eom_obj.execute(input_hash)
72
# Check to see if we are supposed to compute analytical gradients, only do if
74
# 2. The user requested it
75
# 3. The wavefunction is CCSD
76
if get_gradients == true and CCEom.supports_analytic_gradients[reference] == true and wavefunction.casecmp("eom_ccsd") == 0
79
cclambda(input_hash, :binary => Psi::Commands::CCLAMBDA_EXCITED)
80
ccdensity(input_hash, :binary => Psi::Commands::CCDENSITY_CALC_XI)
81
cclambda(input_hash, :binary => Psi::Commands::CCLAMBDA_ZETA)
82
ccdensity(input_hash, :binary => Psi::Commands::CCDENSITY_USE_ZETA)
85
# Tell transqt to do a back transformation
86
transqt_input_hash = input_hash
87
transqt_input_hash[:backtr] = true
88
transqt(transqt_input_hash)
98
# Create some global functions
99
# User can send additional input parameters to the function
103
Psi::global_task.eom(args_hash)