class_docstr: A class for representing rational function fields. 
class_docstr_tok: ["A","class","for","representing","rational","function","fields","."]
docstr: Convert a fraction field element to another fraction field.
  
  Examples
  ========
  
  >>> from sympy.polys.polyclasses import DMF
  >>> from sympy.polys.domains import ZZ, QQ
  >>> from sympy.abc import x
  
  >>> f = DMF(([ZZ(1), ZZ(2)], [ZZ(1), ZZ(1)]), ZZ)
  
  >>> QQx = QQ.old_frac_field(x)
  >>> ZZx = ZZ.old_frac_field(x)
  
  >>> QQx.from_FractionField(f, ZZx)
  DMF([1, 2], [1, 1], QQ)
docstr_tok: ["Convert","a","fraction","field","element","to","another","fraction","field",".","Examples","========",">",">",">","from","sympy.polys.polyclasses","import","DMF",">",">",">","from","sympy.polys.domains","import","ZZ",",","QQ",">",">",">","from","sympy.abc","import","x",">",">",">","f","=","DMF","(","(","[","ZZ","(","1",")",",","ZZ","(","2",")","]",",","[","ZZ","(","1",")",",","ZZ","(","1",")","]",")",",","ZZ",")",">",">",">","QQx","=","QQ.old_frac_field","(","x",")",">",">",">","ZZx","=","ZZ.old_frac_field","(","x",")",">",">",">","QQx.from_FractionField","(","f",",","ZZx",")","DMF","(","[","1",",","2","]",",","[","1",",","1","]",",","QQ",")"]
code: def from_FractionField(K1, a, K0):
      """
      Convert a fraction field element to another fraction field.
  
      Examples
      ========
  
      >>> from sympy.polys.polyclasses import DMF
      >>> from sympy.polys.domains import ZZ, QQ
      >>> from sympy.abc import x
  
      >>> f = DMF(([ZZ(1), ZZ(2)], [ZZ(1), ZZ(1)]), ZZ)
  
      >>> QQx = QQ.old_frac_field(x)
      >>> ZZx = ZZ.old_frac_field(x)
  
      >>> QQx.from_FractionField(f, ZZx)
      DMF([1, 2], [1, 1], QQ)
  
      """
      if K1.gens == K0.gens:
          if K1.dom == K0.dom:
              return a
          else:
              return K1(
                  (
                      a.numer().convert(K1.dom).to_list(),
                      a.denom().convert(K1.dom).to_list(),
                  )
              )
      elif set(K0.gens).issubset(K1.gens):
          nmonoms, ncoeffs = _dict_reorder(
              a.numer().to_dict(), K0.gens, K1.gens
          )
          dmonoms, dcoeffs = _dict_reorder(
              a.denom().to_dict(), K0.gens, K1.gens
          )
  
          if K1.dom != K0.dom:
              ncoeffs = [K1.dom.convert(c, K0.dom) for c in ncoeffs]
              dcoeffs = [K1.dom.convert(c, K0.dom) for c in dcoeffs]
  
          return K1(
              (dict(zip(nmonoms, ncoeffs)), dict(zip(dmonoms, dcoeffs)))
          )
  
imports: from sympy.polys.domains.field import Field
  from sympy.polys.domains.compositedomain import CompositeDomain
  from sympy.polys.polyclasses import DMF
  from sympy.polys.polyerrors import GeneratorsNeeded
  from sympy.polys.polyutils import dict_from_basic, basic_from_dict, _dict_reorder
  from sympy.utilities import public
label_desc: Use image node_id 16 for calling the FractionField obj's underlying member method code with example usage: obj.from_FractionField(K1, a, K0) and returns: a, K1, K1