original_docstring: Define a ProjectQ compiler engine that is common for use with UCCSD
  
      This defines a ProjectQ compiler engine that decomposes time evolution
      gates using a first order Trotter decomposition on non-commuting gates
      down to a base gate decomposition.
  
      Args:
          compiler_backend(projectq.backend): Define the backend on the
              circuit compiler, so that it may either simulate gates numerically
              or alternatively print a gate sequence, e.g. using
              projectq.backends.CommandPrinter()
  
      Returns:
          projectq.cengine that is the compiler engine set up with these
              rules and decompostions.
      
docstring: Define a ProjectQ compiler engine that is common for use with UCCSD
  This defines a ProjectQ compiler engine that decomposes time evolution
  gates using a first order Trotter decomposition on non-commuting gates
  down to a base gate decomposition.
docstring_tokens: Define a ProjectQ compiler engine that is common for use with UCCSD This defines a ProjectQ compiler engine that decomposes time evolution gates using a first order Trotter decomposition on non - commuting gates down to a base gate decomposition .
code: def uccsd_trotter_engine(compiler_backend=projectq.backends.Simulator()):
      """Define a ProjectQ compiler engine that is common for use with UCCSD
  
      This defines a ProjectQ compiler engine that decomposes time evolution
      gates using a first order Trotter decomposition on non-commuting gates
      down to a base gate decomposition.
  
      Args:
          compiler_backend(projectq.backend): Define the backend on the
              circuit compiler, so that it may either simulate gates numerically
              or alternatively print a gate sequence, e.g. using
              projectq.backends.CommandPrinter()
  
      Returns:
          projectq.cengine that is the compiler engine set up with these
              rules and decompostions.
      """
      rule_set = \
          projectq.cengines. \
          DecompositionRuleSet(modules=[projectq.setups.decompositions])
      trotter_rule_set = projectq.cengines. \
          DecompositionRule(gate_class=projectq.ops.TimeEvolution,
                            gate_decomposer=_first_order_trotter,
                            gate_recognizer=_identify_non_commuting)
      rule_set.add_decomposition_rule(trotter_rule_set)
      replacer = projectq.cengines.AutoReplacer(rule_set)
  
      # Start the compiler engine with these rules
      compiler_engine = projectq.\
          MainEngine(backend=compiler_backend,
                     engine_list=[replacer,
                                  projectq.
                                  cengines.InstructionFilter(_two_gate_filter),
                                  projectq.cengines.LocalOptimizer(3)])
      return compiler_engine
code_tokens: def uccsd_trotter_engine ( compiler_backend = projectq . backends . Simulator ( ) ) : rule_set = projectq . cengines . DecompositionRuleSet ( modules = [ projectq . setups . decompositions ] ) trotter_rule_set = projectq . cengines . DecompositionRule ( gate_class = projectq . ops . TimeEvolution , gate_decomposer = _first_order_trotter , gate_recognizer = _identify_non_commuting ) rule_set . add_decomposition_rule ( trotter_rule_set ) replacer = projectq . cengines . AutoReplacer ( rule_set ) compiler_engine = projectq . MainEngine ( backend = compiler_backend , engine_list = [ replacer , projectq . cengines . InstructionFilter ( _two_gate_filter ) , projectq . cengines . LocalOptimizer ( 3 ) ] ) return compiler_engine
short_docstring: Define a ProjectQ compiler engine that is common for use with UCCSD
  This defines a ProjectQ compiler engine that decomposes time evolution
  gates using a first order Trotter decomposition on non-commuting gates
  down to a base gate decomposition.
short_docstring_tokens: Define a ProjectQ compiler engine that is common for use with UCCSD This defines a ProjectQ compiler engine that decomposes time evolution gates using a first order Trotter decomposition on non - commuting gates down to a base gate decomposition .
comment: """Define a ProjectQ compiler engine that is common for use with UCCSD
  
      This defines a ProjectQ compiler engine that decomposes time evolution
      gates using a first order Trotter decomposition on non-commuting gates
      down to a base gate decomposition.
  
      Args:
          compiler_backend(projectq.backend): Define the backend on the
              circuit compiler, so that it may either simulate gates numerically
              or alternatively print a gate sequence, e.g. using
              projectq.backends.CommandPrinter()
  
      Returns:
          projectq.cengine that is the compiler engine set up with these
              rules and decompostions.
      """$SEP$# Start the compiler engine with these rules