Author Topic: Name error in Cosmosolvationparameter  (Read 3290 times)

0 Members and 1 Guest are viewing this topic.

Offline Akash Ramasamy

  • Regular QuantumATK user
  • **
  • Posts: 16
  • Country: in
  • Reputation: 0
    • View Profile
Name error in Cosmosolvationparameter
« on: December 21, 2023, 14:25 »
Hello everyone,
I am trying to run the py file given in the tutorials for solvation energy in 2023 version [( https://docs.quantumatk.com/manual/Types/SolvationEnergy/SolvationEnergy.html#NL.Analysis.SolvationEnergy.SolvationEnergy ) and I am getting name error.  So What I do to solve the error?

 
# Set minimal log verbosity
setVerbosity(MinimalLog)

# Define elements
elements = [Nitrogen, Hydrogen, Hydrogen, Hydrogen]

# Define coordinates
cartesian_coordinates = [[ 0.            ,  0.            ,  0.            ],
                         [ 1.06999992324 ,  0.            ,  0.            ],
                         [-0.35666664108 ,  0.            , -1.008805602123],
                         [-0.35666664108 , -0.873651278919,  0.504402801062]]*Angstrom

# Set up configuration
configuration = MoleculeConfiguration(
    elements=elements,
    cartesian_coordinates=cartesian_coordinates
)

#----------------------------------------
# Basis Set
#----------------------------------------
basis_set = [
    BasisGGAPseudoDojo.Hydrogen_High,
    BasisGGAPseudoDojo.Nitrogen_High,
]

solvation_parameters = CosmoSolvationParameters(
    solvent_dielectric_constant=2.3741,
    solvent_surface_tension=27.9*dyne/cm
)

calculator = LCAOCalculator(
    basis_set=basis_set,
    solvation_parameters=solvation_parameters
)

# Set the calculator
configuration.setCalculator(calculator)
configuration.update()
nlsave('ammonia_toluene.hdf5', configuration)

# Optimize the geometry
optimized_configuration = OptimizeGeometry(
    configuration=configuration,
    trajectory_filename='ammonia_toluene.hdf5'
)
nlsave('ammonia_toluene.hdf5', optimized_configuration)

# Calculate the solvation energy
solvation_energy = SolvationEnergy(
    configuration=optimized_configuration
)
nlsave('ammonia_toluene.hdf5', solvation_energy)

------------------------------------------------------
+------------------------------------------------------------------------------+
|                                                                              |
|                                  QuantumATK®                                 |
|                                                                              |
|          Version: T-2022.03 for Windows and Linux [Build 17f5b1eb610]        |
|                                                                              |
|                      Copyright © 2004-2023 Synopsys, Inc.                    |
|                                                                              |
|       This software and all associated documentation are proprietary to      |
|         Synopsys, Inc. This software may only be used pursuant to the        |
|       terms and conditions of a written license agreement with Synopsys,     |
|       Inc. All other use, reproduction, modification, or distribution of     |
|                     this software is strictly prohibited.                    |
|                                                                              |
+------------------------------------------------------------------------------+
Traceback (most recent call last):
  File "/opt/home/Akash/Zigzag/dd_chk/dd_chk.py", line 27, in <module>
    solvation_parameters = CosmoSolvationParameters(
NameError: name 'CosmoSolvationParameters' is not defined
Traceback (most recent call last):
  File "/opt/home/Akash/Zigzag/dd_chk/dd_chk.py", line 27, in <module>
    solvation_parameters = CosmoSolvationParameters(
NameError: name 'CosmoSolvationParameters' is not defined
Traceback (most recent call last):
  File "/opt/home/Akash/Zigzag/dd_chk/dd_chk.py", line 27, in <module>
    solvation_parameters = CosmoSolvationParameters(
NameError: name 'CosmoSolvationParameters' is not defined
application called MPI_Abort(MPI_COMM_WORLD, 1) - process 4
application called MPI_Abort(MPI_COMM_WORLD, 1) - process 6


Offline filipr

  • QuantumATK Staff
  • Heavy QuantumATK user
  • *****
  • Posts: 81
  • Country: dk
  • Reputation: 6
  • QuantumATK developer
    • View Profile
Re: Name error in Cosmosolvationparameter
« Reply #1 on: December 21, 2023, 15:45 »
From the log output it states that you are using version T-2022.03. The Cosmo solvation model was first introduced in the U-2022.12, see release notes: https://www.synopsys.com/content/dam/synopsys/silicon/quantum-atk/pdf/qatk-datasheet-u-2022-12-release-notes.pdf

So solution is to upgrade to a newer version.

Offline Akash Ramasamy

  • Regular QuantumATK user
  • **
  • Posts: 16
  • Country: in
  • Reputation: 0
    • View Profile
Re: Name error in Cosmosolvationparameter
« Reply #2 on: December 28, 2023, 06:43 »
Thank you. Now I have the solvation energy.