original_docstring: Create a ProjectQ evolution operator for a UCCSD singlet circuit
  
      Args:
          packed_amplitudes(ndarray): Compact array storing the unique single
              and double excitation amplitudes for a singlet UCCSD operator.
              The ordering lists unique single excitations before double
              excitations.
          n_qubits(int): Number of spin-orbitals used to represent the system,
              which also corresponds to number of qubits in a non-compact map.
          n_electrons(int): Number of electrons in the physical system
          fermion_transform(fermilib.transform): The transformation that
              defines the mapping from Fermions to QubitOperator.
  
      Returns:
          evoution_operator(projectq.ops.TimeEvolution): The unitary operator
              that constructs the UCCSD singlet state.
      
docstring: Create a ProjectQ evolution operator for a UCCSD singlet circuit
docstring_tokens: Create a ProjectQ evolution operator for a UCCSD singlet circuit
code: def uccsd_singlet_evolution(packed_amplitudes, n_qubits, n_electrons,
                              fermion_transform=jordan_wigner):
      """Create a ProjectQ evolution operator for a UCCSD singlet circuit
  
      Args:
          packed_amplitudes(ndarray): Compact array storing the unique single
              and double excitation amplitudes for a singlet UCCSD operator.
              The ordering lists unique single excitations before double
              excitations.
          n_qubits(int): Number of spin-orbitals used to represent the system,
              which also corresponds to number of qubits in a non-compact map.
          n_electrons(int): Number of electrons in the physical system
          fermion_transform(fermilib.transform): The transformation that
              defines the mapping from Fermions to QubitOperator.
  
      Returns:
          evoution_operator(projectq.ops.TimeEvolution): The unitary operator
              that constructs the UCCSD singlet state.
      """
      # Build UCCSD generator
      fermion_generator = uccsd_singlet_operator(packed_amplitudes,
                                                 n_qubits,
                                                 n_electrons)
      # Transform generator to qubits
      qubit_generator = fermion_transform(fermion_generator)
  
      # Cast to real part only for compatibility with current ProjectQ routine
      for key in qubit_generator.terms:
          qubit_generator.terms[key] = float(qubit_generator.terms[key].imag)
      qubit_generator.compress()
  
      # Allocate wavefunction and act evolution on gate according to compilation
      evolution_operator = projectq.ops.\
          TimeEvolution(time=1.,
                        hamiltonian=qubit_generator)
  
      return evolution_operator
code_tokens: def uccsd_singlet_evolution ( packed_amplitudes , n_qubits , n_electrons , fermion_transform = jordan_wigner ) : fermion_generator = uccsd_singlet_operator ( packed_amplitudes , n_qubits , n_electrons ) qubit_generator = fermion_transform ( fermion_generator ) for key in qubit_generator . terms : qubit_generator . terms [ key ] = float ( qubit_generator . terms [ key ] . imag ) qubit_generator . compress ( ) evolution_operator = projectq . ops . TimeEvolution ( time = 1. , hamiltonian = qubit_generator ) return evolution_operator
short_docstring: Create a ProjectQ evolution operator for a UCCSD singlet circuit
short_docstring_tokens: Create a ProjectQ evolution operator for a UCCSD singlet circuit
comment: """Create a ProjectQ evolution operator for a UCCSD singlet circuit
  
      Args:
          packed_amplitudes(ndarray): Compact array storing the unique single
              and double excitation amplitudes for a singlet UCCSD operator.
              The ordering lists unique single excitations before double
              excitations.
          n_qubits(int): Number of spin-orbitals used to represent the system,
              which also corresponds to number of qubits in a non-compact map.
          n_electrons(int): Number of electrons in the physical system
          fermion_transform(fermilib.transform): The transformation that
              defines the mapping from Fermions to QubitOperator.
  
      Returns:
          evoution_operator(projectq.ops.TimeEvolution): The unitary operator
              that constructs the UCCSD singlet state.
      """$SEP$# Build UCCSD generator$SEP$# Transform generator to qubits$SEP$# Cast to real part only for compatibility with current ProjectQ routine$SEP$# Allocate wavefunction and act evolution on gate according to compilation