code: public double calculateGHEffectiveAtomPolarizability(IAtomContainer atomContainer, IAtom atom,
              boolean addExplicitH, int[][] distanceMatrix) {
          double polarizabilitiy = 0;
  
          IAtomContainer acH;
          if (addExplicitH) {
              acH = atomContainer.getBuilder().newInstance(IAtomContainer.class, atomContainer);
              addExplicitHydrogens(acH);
          } else {
              acH = atomContainer;
          }
          double bond;
          polarizabilitiy += getKJPolarizabilityFactor(acH, atom);
          for (int i = 0; i < acH.getAtomCount(); i++) {
              if (!acH.getAtom(i).equals(atom)) {
                  int atomIndex = atomContainer.indexOf(atom);
                  bond = distanceMatrix[atomIndex][i];
                  if (bond == 1) {
                      polarizabilitiy += getKJPolarizabilityFactor(acH, acH.getAtom(i));
                  } else {
                      polarizabilitiy += (Math.pow(0.5, bond - 1) * getKJPolarizabilityFactor(acH, acH.getAtom(i)));
                  }//if bond==0
              }//if !=atom
          }//for
          return polarizabilitiy;
      }
docs: calculate effective atom polarizability.
  
  @param atomContainer         IAtomContainer
  @param atom                  atom for which effective atom polarizability should be calculated
  @param addExplicitH          if set to true, then explicit H's will be added, otherwise it assumes that they have
  been added to the molecule before being called
  @param distanceMatrix        an n x n matrix of topological distances between all the atoms in the molecule.
  if this argument is non-null, then BFS will not be used and instead path lengths will be looked up. This
  form of the method is useful, if it is being called for multiple atoms in the same molecule
  @return polarizabilitiy