setups

The setups package contains a collection of setups which can be loaded by the MainEngine. Each setup then loads its own set of decomposition rules and default compiler engines.

Example:
import projectq.setups.ibm
from projectq import MainEngine
eng = MainEngine(setup=projectq.setups.ibm)
# eng uses the default Simulator backend
Note:
One can either provide an engine_list or a setup to the MainEngine but not both.

The subpackage decompositions contains all the individual decomposition rules which can be given to, e.g., an AutoReplacer.

Subpackages

Submodules

Each of the submodules contains a setup which can be loaded by the MainEngine :

projectq.setups.default Defines the default setup which provides an engine_list for the MainEngine
projectq.setups.ibm Defines a setup useful for the IBM QE chip with 5 qubits.
projectq.setups.ibm16 Defines a setup useful for the IBM QE chip with 16 qubits.

default

Defines the default setup which provides an engine_list for the MainEngine

It contains LocalOptimizers and an AutoReplacer which uses most of the decompositions rules defined in projectq.setups.decompositions

projectq.setups.default.get_engine_list()[source]

ibm

Defines a setup useful for the IBM QE chip with 5 qubits.

It provides the engine_list for the MainEngine, and contains an AutoReplacer with most of the gate decompositions of ProjectQ, among others it includes:

  • Controlled z-rotations –> Controlled NOTs and single-qubit rotations
  • Toffoli gate –> CNOT and single-qubit gates
  • m-Controlled global phases –> (m-1)-controlled phase-shifts
  • Global phases –> ignore
  • (controlled) Swap gates –> CNOTs and Toffolis
  • Arbitrary single qubit gates –> Rz and Ry
  • Controlled arbitrary single qubit gates –> Rz, Ry, and CNOT gates

Moreover, it contains LocalOptimizers and a custom mapper for the CNOT gates.

projectq.setups.ibm.get_engine_list()[source]

ibm16

Defines a setup useful for the IBM QE chip with 16 qubits.

It provides the engine_list for the MainEngine, and contains an AutoReplacer with most of the gate decompositions of ProjectQ, among others it includes:

  • Controlled z-rotations –> Controlled NOTs and single-qubit rotations
  • Toffoli gate –> CNOT and single-qubit gates
  • m-Controlled global phases –> (m-1)-controlled phase-shifts
  • Global phases –> ignore
  • (controlled) Swap gates –> CNOTs and Toffolis
  • Arbitrary single qubit gates –> Rz and Ry
  • Controlled arbitrary single qubit gates –> Rz, Ry, and CNOT gates

Moreover, it contains LocalOptimizers.

Note

This setup does not yet contain an automatic mapper. The mapping needs to be done manually using the ManualMapper.

projectq.setups.ibm16.get_engine_list()[source]

Module contents