code: def _write_bond_information(xml_file, structure, ref_distance, ref_energy):
      
  
      unique_bond_types = set()
      xml_file.write('<bond>\n')
      for bond in structure.bonds:
          t1, t2 = bond.atom1.type, bond.atom2.type
          if t1 == '' or t2 == '':
              t1, t2 = bond.atom1.name, bond.atom2.name
          t1, t2 = sorted([t1, t2])
          try:
              bond_type = ('-'.join((t1, t2)), bond.type.k, bond.type.req)
          except AttributeError:  # no forcefield applied, bond.type is None
              bond_type = ('-'.join((t1, t2)), 0.0, 0.0)
          unique_bond_types.add(bond_type)
          xml_file.write('{} {} {}\n'.format(
              bond_type[0], bond.atom1.idx, bond.atom2.idx))
      xml_file.write('</bond>\n')
      xml_file.write('<bond_coeffs>\n')
      xml_file.write('<!-- type k r_eq -->\n')
      for bond_type, k, req in unique_bond_types:
          xml_file.write('{} {} {}\n'.format(bond_type,
              k * 2.0 / ref_energy * ref_distance**2.0, req/ref_distance))
      xml_file.write('</bond_coeffs>\n')
docs: Write the bonds in the system.
  
      Parameters
      ----------
      xml_file : file object
          The file object of the hoomdxml file being written
      structure : parmed.Structure
          Parmed structure object
      ref_distance : float, default=1.0
          Reference distance for conversion to reduced units
      ref_energy : float, default=1.0
          Reference energy for conversion to reduced units