Author Topic: how can I get the results from the .nc file?  (Read 5505 times)

0 Members and 1 Guest are viewing this topic.

Offline artingchen

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Reputation: 0
    • View Profile
how can I get the results from the .nc file?
« on: July 27, 2009, 04:31 »
Hi,
I have calculated my job which calculated the I-V curve by making a loop, but I closed the .log file. Now, I want to see the results again, but when I put the .vnl file into the results browser, I cant no t see the all the results any more, it just show the last  value of the current. How can I get all the values of the current under different bias? :(

Offline serhan

  • Heavy QuantumATK user
  • ***
  • Posts: 98
  • Reputation: 1
    • View Profile
Re: how can I get the results from the .nc file?
« Reply #1 on: July 27, 2009, 08:14 »
Hi,

Have you written all the current values to the vnl file? It seems you have written only the last current value. Could you send the input file, or at least the loop part if you don't want to display your geometry?

Cheers
Serhan

Offline zh

  • QuantumATK Support
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1141
  • Reputation: 24
    • View Profile
Re: how can I get the results from the .nc file?
« Reply #2 on: July 27, 2009, 09:42 »
Unfortunately, the calculated values of current are not stored in the '.nc' file. You had better restore your saved '.nc' file and restart the self-consistent calculations to get all values of the current under different bias.

Offline artingchen

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Reputation: 0
    • View Profile
Re: how can I get the results from the .nc file?
« Reply #3 on: July 27, 2009, 14:26 »
oh! my god! all the values of the current cost two weeks.Does it mean that I should spend two weeks in calculating the values again? :(

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5410
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: how can I get the results from the .nc file?
« Reply #4 on: July 27, 2009, 14:38 »
That really depends. Do you have 1 nc file or many (i.e. one for each bias?)

I suggest you post the script you run, so that we can see how it was handling the NC and VNL files. You can mask/remove the geometry if you wish, it's irrelevant.

Offline artingchen

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Reputation: 0
    • View Profile
Re: how can I get the results from the .nc file?
« Reply #5 on: July 30, 2009, 09:57 »
there is only 1 .nc file
and the code is as follow:
for voltage in numpy.arange(0.0, 5.01, 0.1):
   two_probe_method = TwoProbeMethod(
       electrode_parameters = (left_electrode_parameters,right_electrode_parameters),
       exchange_correlation_type = exchange_correlation_type,
       iteration_mixing_parameters = iteration_mixing_parameters,
       electron_density_parameters = electron_density_parameters,
       basis_set_parameters = basis_set_parameters,
       iteration_control_parameters = iteration_control_parameters,
       energy_contour_integral_parameters = energy_contour_integral_parameters,
       two_center_integral_parameters = two_center_integral_parameters,
       electrode_voltages = (voltage, 0)*Volt,
       algorithm_parameters = two_probe_algorithm_parameters
   )

   if processIsMaster(): nlPrint(voltage)
   
   runtime_parameters = runtimeParameters(
       verbosity_level = 10,
       checkpoint_filename = 'C:/Users/617/Desktop/lih2li1.nc'
   )

    # Using initial density from self consistent calculation
    scf = executeSelfConsistentCalculation(
        twoprobe_configuration,
        two_probe_method,
        initial_calculation = scf,
        runtime_parameters = runtime_parameters
    )

   

    ######################################################################
    # Calculate physical properties
    ######################################################################
    current = calculateCurrent(
        self_consistent_calculation = scf,
        brillouin_zone_integration_parameters = brillouinZoneIntegrationParameters((1, 1)),
        green_function_infinitesimal = 1.0e-5*electronVolt,
        number_of_points = 100
    )
    if processIsMaster(): nlPrint(current)
    if processIsMaster(): file.addToSample(current, 'twoprobe_configuration', 'Current')

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5410
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: how can I get the results from the .nc file?
« Reply #6 on: July 30, 2009, 10:32 »
Hmm, good news and bad news... The script is not correctly set up, for many reasons. First, although there is a loop over the voltages, each voltage uses the same checkpoint file, so each voltage overwrites the result of the previous one. To fix this, the line
Code
checkpoint_filename = 'C:/Users/617/Desktop/lih2li1.nc'
needs to be replaced by something like
Code
checkpoint_filename = 'C:/Users/617/Desktop/lih2li1_%g.nc' % voltage
This will make one checkpoint file for each bias. So, unfortunately you have wasted some time computing the scf loop for each bias. At the same time, the computation of the current is not part of the loop. Therefore, the current has only be computed for the last bias point, and thus you didn't waste any time on this part (that was the good news...). By the way, I don't imagine you will be able to converge the calculation for as high bias as 5 V. You should probably limit the range, in the first run, from 0 to 1.5 V or so. To get the current calculation into the loop, you should simply indent those lines one stop (4 spaces), and then also make sure each current is stored in the VNL file under a unique label. Thus, again, something like
Code
if processIsMaster(): file.addToSample(current, 'twoprobe_configuration', 'Current at %g V bias' % voltage)
Oh, and do pipe the output of the calculation to a log file, so you have the printed current values. Since these will be intermixed with all the output from the SCF loop, it might be a bit hard to locate them later. Therefore, I would change the line
Code
if processIsMaster(): nlPrint(current)
to something like
Code
if processIsMaster(): print "Voltage: %g V, Current: %g A" % (voltage.inUnitsOf(Volt), current.inUnitsOf(Ampere))
Then, later, you can "grep" for "Voltage" to get the values from the log file. Actually, you may want to consider splitting the SCF part and the current calculation. That is, just run the loop over voltages but skip the current for now. Then, later, just restore all the checkpoint files and compute the current separately. If you're ok making these changes by yourself, it will be a good exercise :-) But I suggest you post the script before you run it, and then we can verify that you will not be wasting your time again.
« Last Edit: July 30, 2009, 10:36 by Anders Blom »

Offline artingchen

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Reputation: 0
    • View Profile
Re: how can I get the results from the .nc file?
« Reply #7 on: July 30, 2009, 10:41 »
thank you doctor Blom very much!

I will chang it as soon as possible and post it. thank you again!

Offline artingchen

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Reputation: 0
    • View Profile
Re: how can I get the results from the .nc file?
« Reply #8 on: August 2, 2009, 08:05 »
hi, doctor Blom,
is the follow script correct?
Quote
for voltage in numpy.arange(0.0, 5.01, 0.1):
   two_probe_method = TwoProbeMethod(
       electrode_parameters = (left_electrode_parameters,right_electrode_parameters),
       exchange_correlation_type = exchange_correlation_type,
       iteration_mixing_parameters = iteration_mixing_parameters,
       electron_density_parameters = electron_density_parameters,
       basis_set_parameters = basis_set_parameters,
       iteration_control_parameters = iteration_control_parameters,
       energy_contour_integral_parameters = energy_contour_integral_parameters,
       two_center_integral_parameters = two_center_integral_parameters,
       electrode_voltages = (voltage, 0)*Volt,
       algorithm_parameters = two_probe_algorithm_parameters
   )

   
   runtime_parameters = runtimeParameters(
       verbosity_level = 10,
       checkpoint_filename = 'C:/Users/617/Desktop/lih2li1_%g.nc' %voltage
   )
   if processIsMaster(): nlPrint(voltage)

    # Using initial density from self consistent calculation
    scf = executeSelfConsistentCalculation(
        twoprobe_configuration,
        two_probe_method,
        initial_calculation = scf,
        runtime_parameters = runtime_parameters
    )

   

    ######################################################################
    # Calculate physical properties
    ######################################################################
    current = calculateCurrent(
        self_consistent_calculation = scf,
        brillouin_zone_integration_parameters = brillouinZoneIntegrationParameters((1, 1)),
        green_function_infinitesimal = 1.0e-5*electronVolt,
        number_of_points = 100
    )
    if processIsMaster(): print "Voltage: %g V, Current: %g A" % (voltage.inUnitsOf(Volt), current.inUnitsOf(Ampere))
    if processIsMaster(): file.addToSample(current, 'twoprobe_configuration', 'Current at %g V bias' % voltage)
please check it. thank you !
« Last Edit: August 2, 2009, 08:08 by artingchen »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5410
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: how can I get the results from the .nc file?
« Reply #9 on: August 2, 2009, 10:11 »
That looks ok, although note the following:

  • It will be hard to converge the calculation above 1 V bias. I'd limit the voltage range to 0-1 V for now (this is just a test to learn, anyway, right?)
  • The variable "scf" is not initially defined in this code segment. Make sure to have a statement "scf = None" before these lines!
  • You will probably find this post on I-V curves interesting: http://quantumwise.com/forum/index.php?topic=302.0
  • Good luck and have fun! :)

Offline artingchen

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Reputation: 0
    • View Profile
Re: how can I get the results from the .nc file?
« Reply #10 on: August 2, 2009, 10:32 »
thank you ! :)