Skip to content

Commit

Permalink
update readme & minors
Browse files Browse the repository at this point in the history
  • Loading branch information
dakk committed Mar 20, 2024
1 parent a608479 commit 68a4faf
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
Binary file modified docs/source/_images/grover_circ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_images/h_circ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/source/example_grover.ipynb

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions qlasskit/compiler/internalcompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ def compile_expr( # noqa: C901
elif expr in self.expqmap:
return self.expqmap[expr]

# Special mappings sectiona
# Add here special expressions mappings to QC

# (a & b) ^ (a ^ b) & c => MCX(a,b,new), MCX(b,c,new)

# End of speccial mappings section

elif isinstance(expr, Xor):
if dest is None:
d = qc.get_free_ancilla()
Expand Down
18 changes: 9 additions & 9 deletions qlasskit/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def _neq(a, b):


def _eq(a, b):
return Not(_neq(a, b))
return Not(Xor(a, b))


def _half_adder(a, b): # Carry x Sum
Expand All @@ -32,15 +32,15 @@ def _half_adder(a, b): # Carry x Sum

def _full_adder(c, a, b): # Carry x Sum
return (a & b) ^ (a ^ b) & c, Xor(Xor(a, b), c)

# from ..boolquant import H, CX, MCX
# from ..boolquant import Q
# from sympy import Symbol
# o = Symbol('new_qubit')
# o = MCX(a, b, o)
# b = CX(a, b)
# o = MCX(b, c, o)
# c = CX(b,c)
# return c, o
# c_o = Symbol('carry')
# c_o = Q.MCX(a, b, c_o)
# b = Q.CX(a, b)
# c_o = Q.MCX(b, c, c_o)
# c = Q.CX(b, c)
# b = Q.CX(a, b)
# return c_o, c


from .qtype import ( # noqa: F401, E402
Expand Down

0 comments on commit 68a4faf

Please sign in to comment.