Skip to content

Commit

Permalink
rename internalcompiler
Browse files Browse the repository at this point in the history
  • Loading branch information
dakk committed Oct 26, 2023
1 parent 8d721c2 commit c49c063
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 29 deletions.
3 changes: 3 additions & 0 deletions docs/source/howitworks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ The boolean expressions are then being fed to the `qlasskit.compiler`` which tra
to invertible circuits, introducing auxiliary qubits. In this step, the compiler will automatically uncompute
auxiliary qubits in order to reduce the number of qubits needed and the circuit footprint.

For the compilation, two backends are supported:

- InternalCompiler
- Tweedledum.xag_synth


Result
Expand Down
9 changes: 3 additions & 6 deletions qlasskit/compiler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@
from .expqmap import ExpQMap # noqa: F401
from .compiler import Compiler, CompilerException, optimizer # noqa: F401

from .multipass import MultipassCompiler
from .poccompiler2 import POCCompiler2
from .internalcompiler import InternalCompiler
from .poccompiler3 import POCCompiler3
from .tweedledumcompiler import TweedledumCompiler


def to_quantum(name, args, returns, exprs, compiler="tw"):
if compiler == "multipass":
s = MultipassCompiler()
elif compiler == "poc2":
s = POCCompiler2()
if compiler == "int":
s = InternalCompiler()
elif compiler == "poc3":
s = POCCompiler3()
elif compiler == "tw":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
from . import Compiler, CompilerException, ExpQMap


class POCCompiler2(Compiler):
"""POC2 compiler translating an expression list to quantum circuit"""
class InternalCompiler(Compiler):
"""InternalCompiler translating an expression list to quantum circuit"""

def compile(self, name, args: Args, returns: Arg, exprs: BoolExpList) -> QCircuit:
qc = QCircuit(name=name)
Expand Down
19 changes: 0 additions & 19 deletions qlasskit/compiler/multipass.py

This file was deleted.

4 changes: 2 additions & 2 deletions qlasskit/qcircuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def toffoli(q0, q1, q2):
raise Exception("Not implemented yet")
elif g == "mcx":
raise Exception("Not implemented yet")
else:
elif g != "bar":
raise Exception(f"not handled {g}")

if ga:
Expand Down Expand Up @@ -361,7 +361,7 @@ def __qiskit_export(self, mode: Literal["circuit", "gate"]): # noqa: C901
qc.fredkin(w[0], w[1], w[2])
elif g == "mcrx":
qc.append(RXGate(p).control(len(w[0:-1])), w)
else:
elif g != "bar":
raise Exception(f"not handled {g}")

if mode == "gate":
Expand Down

0 comments on commit c49c063

Please sign in to comment.