qiskit-advocate / qamp-spring-22

Qiskit advocate mentorship program (QAMP) spring 22 cohort (Mar - Jun 2022)
13 stars 1 forks source link

Add implementation of PatternMatch to retworkx #26

Closed IvanIsCoding closed 2 years ago

IvanIsCoding commented 2 years ago

Description

retworkx is a high-performance graph library used internally by Qiskit, PennyLane, and other projects. retworkx contains efficient implementations of graph algorithms, and Qiskit Terra leverages those algorithms to efficiently manipulate quantum circuits internally.

This project is about implementing Exact and practical pattern matching for quantum circuit optimization by Iten et al. using retworkx. Qiskit Terra has an implementation of Pattern Matching (https://github.com/Qiskit/qiskit-terra/blob/master/qiskit/transpiler/passes/optimization/template_matching/template_matching.py) which is built on top of DAGDependency (https://github.com/Qiskit/qiskit-terra/blob/master/qiskit/dagcircuit/dagdependency.py).

Ideally we'd be able to replace most of current implementation with a retworkx function, such that the transpile pass can be executed faster and included as a default in Qiskit Terra. We note that maybe not all of the Python code can be ported, hence using Cython or mypyc might also became part of the project if desired.

Deliverables

Mentors details

Number of mentees

1

Type of mentees

HuangJunye commented 2 years ago

Closing this issue as it was not paired with any mentee. Thank you for suggesting the project idea!