/qosf_task1

My quantum algorithm for the solution to task 1 of QOSF cohort 4 screening tests. The code is written using QISKIT. 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.

Primary LanguageJupyter NotebookApache License 2.0Apache-2.0

qosf_task1

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.

To execute the code:

  1. Run the given two blocks of codes.
  2. 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])
  3. 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.

The code works for any kind of list of integers, even for lists with repeated entries.