Skip to content

Commit

Permalink
removed the necessity of the is_root QuantumBool
Browse files Browse the repository at this point in the history
  • Loading branch information
positr0nium committed Jan 26, 2024
1 parent 68fe7ca commit 5e3a2f4
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/qrisp/quantum_backtracking/backtracking_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,16 @@ def accept(tree):
# into a temporary container. This way the branching information is 0.

# Check if |x> is root.
is_root = QuantumBool()
cx(self.h[self.max_depth],is_root)


# This
if self.max_depth%2 == even:
cx(self.h[self.max_depth],oddity_qbl)

# Instead of this

# is_root = QuantumBool()
# cx(self.h[self.max_depth],is_root)

temporary_container = self.branch_qa.qtype.duplicate()

Expand All @@ -730,8 +738,8 @@ def accept(tree):
ctrl_state += "0"

# Check if |x> is root. Otherwise, if the reject funtions returns "True" on the lift of the root a wrong phase (-1) may be applied to the root.
mcz_list.append(is_root)
ctrl_state += "0"
# mcz_list.append(is_root)
# ctrl_state += "0"


# Add extra controls
Expand Down

0 comments on commit 5e3a2f4

Please sign in to comment.