Author Topic: How to create MPSH in new version  (Read 7191 times)

0 Members and 1 Guest are viewing this topic.

Offline vihardabest

  • Regular QuantumATK user
  • **
  • Posts: 22
  • Country: gb
  • Reputation: 0
  • Vihar Georgiev
    • View Profile
How to create MPSH in new version
« on: August 11, 2010, 10:37 »
Dear all,
I am a little bit confuse with the new version. My aim is to project Hamiltonian in the scattering region.
In the old version I used this script:
######################################
from ATK.TwoProbe import *

# Restore initial density from old calculation
scf = restoreSelfConsistentCalculation("name.nc")

vnl_file = VNLFile('name.vnl')
atomic_configuration = vnl_file.readAtomicConfigurations()['name']

projected_hamiltonian_eigenstates = calculateProjectedHamiltonianEigenstates(
    self_consistent_calculation = scf,
    projection_atoms = (32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76),
   quantum_numbers = [(72,73,74,75),Spin.Up]
)


vnl_file = VNLFile("name-MPSH.vnl")
vnl_file.addToSample(atomic_configuration,'name-MPSH')
for projected_hamiltonian_eigenstates_index,state in enumerate(projected_hamiltonian_eigenstates):
    label = 'Projected Hamiltonian Eigenstates-0V'+' '+str(projected_hamiltonian_eigenstates_index)
    vnl_file.addToSample(state, 'name-MPSH', label)
#############################################################################

So now in the new Nanolenguage :
instead to used readAtomicConfiguration I should use nlread ('name-file', object_id="gID000")[0]

That is Ok.

Now, how I should replace restartSelfConsistentCoalculations?

How to save my output file because the new version is not using .vnl files anymore?

Or with one word can you just write a small script from the beginning to the end, please?

Few more points that I noticed :
When I have Transmission spectra  in old version was possible to place the mouse at some point of the screen and I will have X and Y coordinates. The same was valid for the Molecule Energy spectra. It was possible to see the number of Molecule orbital and the energy from the window. In the new version it is not possible. I believe that will be very useful and convenient to have these features back in the new version. 

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: How to create MPSH in new version
« Reply #1 on: August 11, 2010, 10:54 »
First of all, good point about the X/Y coordinates, that will be included in the next release. Actually, there is no direct equivalent of restoreSelfConsistentCalculation() in the new version, because the configuration and the "scf" are not (as before) separate objects, but rather the same object. This is nice, bcs it means you keep the geometry and the calculation together all the time. To figure these things out, I generally recommend using VNL for a test case; it will generate a script that shows you how to do it. In your case, you would start the Scripter blank (click the icon, instead of dropping anything on it), then double-click "Analysis from file", and then double-click "Analysis" and choose "Molecular Energy Spectrum". At this point, send the script to the Editor, and you will have
Code: python
configuration = nlread("analysis.nc", object_id="gID000")[0]

molecular_energy_spectrum = MolecularEnergySpectrum(
    configuration=configuration,
    energy_zero_parameter=FermiLevel,
    projection_list=ProjectionList(All)
    )
nlsave('analysis.nc', molecular_energy_spectrum)
nlprint(molecular_energy_spectrum)
As you also see from this, in the new version all the results are saved to an NC file (the same as the configuration, or another one) using nlsave(). And, finally: MolecularEnergySpectrum for device = MPSH in the new version.

Offline vihardabest

  • Regular QuantumATK user
  • **
  • Posts: 22
  • Country: gb
  • Reputation: 0
  • Vihar Georgiev
    • View Profile
Re: How to create MPSH in new version
« Reply #2 on: August 11, 2010, 11:16 »
Hi Anders,
thank you very much for the fast answer. I already have Molecule energy spectra and I know  how to project over the atoms that I need.
The problem that I have is that I want to used this function: calculateProjectedHamiltonianEigenstates

calculateProjectedHamiltonianEigenstates(
    self_consistent_calculation = scf,
    projection_atoms = (32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76),
   quantum_numbers = [(72,73,74,75),Spin.Up]
)

I need the eigenstates in order to able them to relate with the shape of the 'molecule orbitals'. MoleculeEnergySpectrum is giving me only the energies.

In the MoleculeEnergySpectrum class we have only 3 list of argument:
http://quantumwise.com/documents/manuals/latest/ReferenceManual/XHTML/ref.molecularenergyspectrum.html


 MolecularEnergySpectrum(
configuration,
energy_zero_parameter,
projection_list
)

We don have list of argument such as Spin and Quantum Number to be able to specify which number molecule orbitals I need. Is it correct?
Sorry that I am bothering you again with this.

 

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: How to create MPSH in new version
« Reply #3 on: August 11, 2010, 11:20 »
Correct, MoleculeEnergySpectrum() gives you, just like calculateProjectedHamiltonianEnergySpectrum() before, the energy spectrum.

The new equivalent of calculateProjectedHamiltonianEigenstates() is Eigenstate(). There you find the quantum numbers and projection list.

Offline vihardabest

  • Regular QuantumATK user
  • **
  • Posts: 22
  • Country: gb
  • Reputation: 0
  • Vihar Georgiev
    • View Profile
Re: How to create MPSH in new version
« Reply #4 on: August 11, 2010, 11:26 »
Thank you very much. Now it is clear. :)

Offline vihardabest

  • Regular QuantumATK user
  • **
  • Posts: 22
  • Country: gb
  • Reputation: 0
  • Vihar Georgiev
    • View Profile
Re: How to create MPSH in new version
« Reply #5 on: August 11, 2010, 11:47 »
Hi Anders,
I made this input script  in the way that you suggested:
#################################################
configuration = nlread("name.nc", object_id="gID000")[0]

projection_list = ProjectionList([80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124])
eigenstate = Eigenstate(
    configuration=configuration,
    quantum_number=82,
    projection_list=projection_list,
    spin=Spin.Up,
    )
nlsave('name-MPSH.nc', eigenstate, labels=['82Up'])
#################################################################################

And the program gives this error :

+------------------------------------------------------------------------------+
| NanoLanguageScript execution started                                         |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
|                                                                              |
| Atomistix ToolKit 10.8.0                                                     |
|                                                                              |
+------------------------------------------------------------------------------+
Traceback (most recent call last):
  File "/tmp/5734084645051856.py", line 10, in <module>
    spin=Spin.Up,
  File "./zipdir/NL/Analysis/Eigenstate.py", line 47, in __init__
  File "./zipdir/NL/Analysis/AnalysisUtilities.py", line 17, in checkConfiguration
NL.ComputerScienceUtilities.Exceptions.NLTypeError: The parameter, configuration, must be an instance of the MoleculeConfiguration.

NanoLanguageScript execution failure
+------------------------------------------------------------------------------+
| NanoLanguageScript execution finished                                        |
+------------------------------------------------------------------------------+

Do you have an idea what the problem is?

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: How to create MPSH in new version
« Reply #6 on: August 11, 2010, 11:54 »
I deeply apologize. This should be possible, but apparently it is not (which in fact is clear from the manual, I should have noticed that).

Thus, sadly, with this version you can not get the MPSH eigenstates, only the spectrum. We will make it a priority to add this functionality as soon as possible.

Offline vihardabest

  • Regular QuantumATK user
  • **
  • Posts: 22
  • Country: gb
  • Reputation: 0
  • Vihar Georgiev
    • View Profile
Re: How to create MPSH in new version
« Reply #7 on: August 11, 2010, 11:57 »
Ok, don't worry. Thank you very much for your help.

Have a nice day. :)

Offline jdgayles16

  • QuantumATK Guru
  • ****
  • Posts: 108
  • Reputation: 0
    • View Profile
Re: How to create MPSH in new version
« Reply #8 on: August 11, 2010, 21:35 »
Does this work for the device, Can i get the energy eigenstates for a projected list of atoms?

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: How to create MPSH in new version
« Reply #9 on: August 11, 2010, 21:38 »
No, not the 3d representation. Spectrum yes.

We're trying to figure out some work-around. After all, this is Python, so we can just code it up as a script! We'll see how complicated it has to become, however.