QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: weixiang on January 20, 2019, 20:05

Title: How to export the spectral current from InelasticTransmission spectrum
Post by: weixiang on January 20, 2019, 20:05
Hi,
Is there a way to calculate the spectral current from the InelasticTransmission spectrum object? e.g. just like the regular method used in normal transmission spectrum TransmissionSpectrum.spectralCurrent()?
I checked the manual, but there is no such method or any related method for InelasticTransmission class.
In the VNL, from the Inelastic Transmission Spectrum Analyzer I can see the spectral current, but I don't know how to export the data.

Thank you in advance for any help!
Title: Re: How to export the spectral current from InelasticTransmission spectrum
Post by: Daniele Stradi on January 21, 2019, 09:26
Hi,

the method implemented in the InelasticTransmissionSpectrum tool does not allow for the calculation of the spectral current in the same way as done in the TransmissionSpectrum tool. Probably what you need is to use the inelasticCurrent query function, see https://docs.quantumwise.com/manual/Types/InelasticTransmissionSpectrum/InelasticTransmissionSpectrum.html

If you can attach a snapshot of the plot that you are interested in, then we could be more precise.

Best regards,
Daniele
Title: Re: How to export the spectral current from InelasticTransmission spectrum
Post by: weixiang on January 21, 2019, 19:51
Thank for the reply!
What I am interested in is the Spectral current plot type provided in the Inelastic Transmission Spectrum Analyzer. (see attached image)
I can see the spectral current but cannot export the data for further processing.
Title: Re: How to export the spectral current from InelasticTransmission spectrum
Post by: weixiang on January 23, 2019, 21:42
Anyone has any thought about my question?
Title: Re: How to export the spectral current from InelasticTransmission spectrum
Post by: Anders Blom on April 19, 2019, 21:06
We actually provide the source code for most plugins, so you can find how the spectral current is computed by inspecting the Python code of the Inelastic Transmission Spectrum Analyzer in lib/site-packages/AddOns.
You will then find this:

Code: python
def plotSpectralCurrent(self):
        """
        Plot spectral current vs. energy.
        """
        # Get the inelastic transmission spectrum object.
        its = self._model['inelastic_transmission_spectrum']

        # Get data from model.
        bias_point     = self._model['bias_point'] * Volt
        fermi_shift    = self._model['fermi_shift'] * eV
        temperature    = self._model['temperature'] * Kelvin
        phonon_modes   = self._phononModes()
        kpoints        = self._kPoints()
        qpoints        = self._qPoints()
        spin           = self._model['spin']

        # Calculate spectral current
        i, i_s, energies = its.inelasticCurrentIntegral(bias=bias_point,
                                                        modes=phonon_modes,
                                                        temperature=temperature,
                                                        fermi_shift=fermi_shift,
                                                        k_indices=kpoints,
                                                        q_indices=qpoints,
                                                        spin=spin)
        i_s = i_s.inUnitsOf(Ampere/eV)[0, :]

        self.figure().clear()
        self._axes1 = self.figure().add_subplot(111)
        self._plot1 = self._axes1.plot(energies.inUnitsOf(eV), i_s, 'k-')

        self._axes1.set_xlabel('Energy (eV)')
        self._axes1.set_ylabel('Spectral current (A/eV)')

        self.draw()

You should be able to use this in a script to get what you need. Also see https://docs.quantumatk.com/manual/Types/InelasticTransmissionSpectrum/InelasticTransmissionSpectrum.html, although it's not so clear from that page...