My quantum algorithm for the solution to task 1 of QOSF cohort 4 screening tests. The code is written using QISKIT.
Problem Statement: The task was to design a quantum circuit that considers as input a vector of integers and returns a quantum state which is a superposition of indices of the target solution. The target solution consists of those integers whose binary representation's adjacent bits have different values.
This contains the .ipynb file to exceute the task 1 of qosf mentorship program. The code is written using QISKIT.
- Run the given two blocks of codes.
- Then define a variable of type Task_1 and initialize it with the list of integers (of any length) as follows:
For eg: c = Task_1([1,5,7,10]) - The output will contain:
a. A histogram indicating the states of superpostion and their coefficient in the superposed state.
b. The state vector of the final quantum state.