get_qubit_registers_for_adder

forest.benchmarking.classical_logic.get_qubit_registers_for_adder(qc: pyquil.api._quantum_computer.QuantumComputer, num_length: int, qubits: Sequence[int] = None) → Tuple[Sequence[int], Sequence[int], int, int]

Searches for a layout among the given qubits for the two n-bit registers and two additional ancilla that matches the simple layout given in figure 4 of [CDKM96].

This method ignores any considerations of physical characteristics of the qc aside from the qubit layout. An error is thrown if the appropriate layout is not found.

Parameters:
  • qc – the quantum resource on which an adder program will be executed.
  • num_length – the length of the bitstring representation of one summand
  • qubits – the available qubits on which to run the adder program.
Returns:

the necessary registers and ancilla labels for implementing an adder program to add the numbers a and b. The output can be passed directly to adder()