qiskit-community / qiskit-hackathon-korea-21

A repository for Qiskit Hackathon Korea (February 16-19, 2021)
33 stars 11 forks source link

Compute if two circuits are equivilent to each other #17

Closed nonhermitian closed 3 years ago

nonhermitian commented 3 years ago

Abstract

It is often of interest to determine if circuits are equivalent to each other, for example when looking at the output from circuit compilation or when comparing different implementations of the same algorithm. This requires determining if the circuits are unitarily equivalent, possibly up to a collection of different transformations. This project will create a basic checker for this.

There is a PR in Qiskit for this (https://github.com/Qiskit/qiskit-terra/pull/5700) but I think it is beneficial to consider a different implementation route [while also learning some about operators and Qiskit :) ]

Description

The idea is to take two circuits as inputs and determine if they are equivalent in the following manners:

1) Exact unitary match. 2) Up to a global phase factor 3) Up to permutation from swap mapping (related to project #2 )

4) Up to a qubit permutation on top of the others.

The first three can be computed in one iteration, while (4) is an expensive computation involving the diagonalization and other checks.

This project should implement the first 3 and then try for 4 if time remains.

Members

Deliverable

A PR to Terra with the completed code.

GitHub repo