class_docstr: The HybridXC module computes XC energy by summing XC energy computed
  from libxc(any conventional DFT functional) and the trainable neural
  network with tunable weights.
  This layer constructs a hybrid functional based on the user's choice
  of what model is to be used to train the functional. (Currently, we only
  support an LDA based model). This hybrid functional is a combination of
  the xc that is trained by a neural network, and a conventional DFT
  functional.
  
  Examples
  --------
  >>> from deepchem.models.dft.nnxc import HybridXC
  >>> import torch
  >>> import torch.nn as nn
  >>> n_input, n_hidden = 2, 1
  >>> nnmodel = (nn.Linear(n_input, n_hidden))
  >>> output = HybridXC("lda_x", nnmodel, aweight0=0.0)
class_docstr_tok: ["The","HybridXC","module","computes","XC","energy","by","summing","XC","energy","computed","from","libxc","(","any","conventional","DFT","functional",")","and","the","trainable","neural","network","with","tunable","weights",".","This","layer","constructs","a","hybrid","functional","based","on","the","user","'s","choice","of","what","model","is","to","be","used","to","train","the","functional",".","(","Currently",",","we","only","support","an","LDA","based","model",")",".","This","hybrid","functional","is","a","combination","of","the","xc","that","is","trained","by","a","neural","network",",","and","a","conventional","DFT","functional",".","Examples","--","--","--","--",">",">",">","from","deepchem.models.dft.nnxc","import","HybridXC",">",">",">","import","torch",">",">",">","import","torch.nn","as","nn",">",">",">","n_input",",","n_hidden","=","2",",","1",">",">",">","nnmodel","=","(","nn.Linear","(","n_input",",","n_hidden",")",")",">",">",">","output","=","HybridXC","(","``","lda_x","''",",","nnmodel",",","aweight0=0.0",")"]
docstr: Get electron density from xc
  This function reflects eqn. 4 in the `paper <https://arxiv.org/abs/2102.04229>_`.
  Parameters
  ----------
  densinfo: Union[ValGrad, SpinParam[ValGrad]]
      Density information calculated using DQC utilities.
  
  Returns
  -------
  Total calculated electron density with tunable weights.
docstr_tok: ["Get","electron","density","from","xc","This","function","reflects","eqn",".","4","in","the","`","paper","<","https",":","\/\/arxiv.org\/abs\/2102.04229",">","_","`",".","Parameters","--","--","--","--","--","densinfo",":","Union","[","ValGrad",",","SpinParam","[","ValGrad","]","]","Density","information","calculated","using","DQC","utilities",".","Returns","--","--","--","-","Total","calculated","electron","density","with","tunable","weights","."]
code: def get_edensityxc(
      self, densinfo: Union[ValGrad, SpinParam[ValGrad]]
  ) -> torch.Tensor:
      """Get electron density from xc
      This function reflects eqn. 4 in the `paper <https://arxiv.org/abs/2102.04229>_`.
      Parameters
      ----------
      densinfo: Union[ValGrad, SpinParam[ValGrad]]
          Density information calculated using DQC utilities.
  
      Returns
      -------
      Total calculated electron density with tunable weights.
      """
      nnxc_ene = self.nnxc.get_edensityxc(densinfo)
      xc_ene = self.xc.get_edensityxc(densinfo)
      aweight = self.weight_activation(self.aweight)
      bweight = self.weight_activation(self.bweight)
      return nnxc_ene * aweight + xc_ene * bweight
  
imports: from abc import abstractmethod
  from typing import Union, List
  import torch
  from dqc.utils.datastruct import ValGrad
  from deepchem.utils.dftutils import SpinParam
  from dqc.api.getxc import get_xc
  from dqc.xc.base_xc import BaseXC
  from dqc.utils.safeops import safenorm, safepow
label_desc: Use image node_id 3 for calling the HybridXC obj's underlying member method code with example usage: obj.get_edensityxc(densinfo) and returns: unknown