def bond_length(element1, element2):
  """
  Returns approximate bond-length between atoms of element1 and element2.

  Bond lengths taken from Handbook of Chemistry and Physics.  The
  information provided there was very specific, so representative
  examples were used to specify the bond lengths.  Sitautions could
  arise where these lengths would be incorrect, probably slight errors
  (<0.06) in the hundreds.

  Parameters
  ----------
  element1: string:
    Name of first element.
  element2: string
    Name of second element.
  """
  # All distances are in Angstroms. Duplicate pairs not specified. For
  # example, to find distance ("H", "C"), the lookup key is ("C", "H")
  distances = {
      ("C", "C"): 1.53,
      ("N", "N"): 1.425,
      ("O", "O"): 1.469,
      ("S", "S"): 2.048,
      ("SI", "SI"): 2.359,

      ("C", "H"): 1.059,
      ("C", "N"): 1.469,
      ("C", "O"): 1.413,
      ("C", "S"): 1.819,
      ("C", "F"): 1.399,
      ("C", "CL"): 1.790,
      ("C", "BR"): 1.910,
      ("C", "I"): 2.162,

      ("N", "H"): 1.009,
      ("N", "O"): 1.463,
      ("N", "BR"): 1.843,
      ("N", "CL"): 1.743,
      ("N", "F"): 1.406,
      ("N", "I"): 2.2,

      ("O", "S"): 1.577,
      ("O", "H"): 0.967,

      # This one not from source sited above. Not sure where it's from, but
      # it wouldn't ever be used in the current context ("AutoGrow")
      ("S", "H"): 2.025/1.5,
      ("S", "N"): 1.633,
      ("S", "BR"): 2.321,
      ("S", "CL"): 2.283,
      ("S", "F"): 1.640,
      ("S", "I"): 2.687,

      ("P", "BR"): 2.366,
      ("P", "CL"): 2.008,
      ("P", "F"): 1.495,
      ("P", "I"): 2.490,
      # estimate based on eye balling Handbook of Chemistry and Physics
      ("P", "O"): 1.6,


      ("SI", "BR"): 2.284,
      ("SI", "CL"): 2.072,
      ("SI", "F"): 1.636,
      ("SI", "P"): 2.264,
      ("SI", "S"): 2.145,
      ("SI", "C"): 1.888,
      ("SI", "N"): 1.743,
      ("SI", "O"): 1.631,

      ("H", "H"): .7414,
  }
  if (element1, element2) in distances:
    return distances[(element1, element2)]
  elif (element2, element1) in distances:
    return distances[(element2, element1)]
  else:
    raise ValueError("Distance between %s and %s is unknown" %
                     (element1, element2))