1 Vo V₁ V3 V₂ V₂ 2

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter4: Making Decisions
Section: Chapter Questions
Problem 5RQ
icon
Related questions
Question

I need help to solve a simple problem using Grover’s algorithm, where the solution is not necessarily known beforehand. The problem is a 2×2 binary sudoku with two rules:

• No column may contain the same value twice.

• No row may contain the same value twice.

 

Each square in the sudoku is assigned to a variable as follows:

 

We want to design a quantum circuit that outputs a valid solution to this sudoku. While using Grover’s algorithm for this task is not necessarily practical, the goal is to demonstrate how classical decision problems can be converted into oracles for Grover’s algorithm.

 

Turning the Problem into a Circuit

 

To solve this, an oracle needs to be created that helps identify valid solutions. The first step is to construct a classical function within a quantum circuit that checks whether a given state satisfies the sudoku rules.

 

Since we need to check both columns and rows, there are four conditions to verify:

v0 ≠ v1   # Check top row  

v2 ≠ v3   # Check bottom row  

v0 ≠ v2   # Check left column  

v1 ≠ v3   # Check right column  

The process consists of three main steps:

1. Creating a reversible classical circuit that verifies a correct solution.

2. Converting this circuit into an oracle.

3. Using Grover’s algorithm to solve for a valid state.

 

Refer to the image below for the variable assignments within the sudoku grid

No AI, No CHATGPT, NO LLM.

 

make sure it runs in Qiskit1.0

please provide the code and the output 

1
Vo V₁
V3
V₂ V₂
2
Transcribed Image Text:1 Vo V₁ V3 V₂ V₂ 2
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
Enhanced Discovering Computers 2017 (Shelly Cashm…
Enhanced Discovering Computers 2017 (Shelly Cashm…
Computer Science
ISBN:
9781305657458
Author:
Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:
Cengage Learning
Systems Analysis and Design (Shelly Cashman Serie…
Systems Analysis and Design (Shelly Cashman Serie…
Computer Science
ISBN:
9781305494602
Author:
Scott Tilley, Harry J. Rosenblatt
Publisher:
Cengage Learning
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr