unitaryfund / mitiq

Mitiq is an open source toolkit for implementing error mitigation techniques on most current intermediate-scale quantum computers.
https://mitiq.readthedocs.io
GNU General Public License v3.0
363 stars 162 forks source link

Pauli Twirling of CNOT Gate #1774

Closed nathanshammah closed 1 year ago

nathanshammah commented 1 year ago

Issue Description

It could be useful to include tools to implement randomized compiling (RC), as noted already in #1245, as the technique is proving useful and widely adopted.

Proposed Solution

A simple approach could be that of applying a subset of the fully general technique, limiting to applying RC to CNOT gates with the introduction of Pauli rotations.

randomized-compiling

Pseudocode below

mitiq.rcc.execute_with_randomized_compiling(circuit, executor, rule="cnot")

where the protocol is similar to digital dynamical decoupling (DDD): it finds, based on a rule, the gates to substitute. It has a difference with respect to DDD, more similar to ZNE or PEC, in the sense that it generates multiple circuits based on one original and includes an extrapolation part (simple average) after the execution.

Additional References

purva-thakre commented 1 year ago

I can take this as part of my previous attempt at a RFC.

I have got one issue that I am currently working on and after that I was planning on linking a newer version of the randomized compiling RFC anyway. This was my plan for the upcoming milestone.

nathanshammah commented 1 year ago

Focusing sounds great to me, @purva-thakre!

purva-thakre commented 1 year ago

@nathanshammah What was your motivation behind using rule="cnot" ?

To me, it looks like you want to apply randomized compiling to the CNOT gate only ? Or just 1 layer in the circuit which might contain other gates along with the CNOT ?

Misty-W commented 1 year ago

Consider reusing PEC modules- idea of replacing a gate. @natestemen, @purva-thakre, @Aaron-Robertson, @andreamari

Aaron-Robertson commented 1 year ago

Here's the current working doc https://docs.google.com/document/d/1RLt1STCn1ct4IJBz61Zd8R1ABR6dZbTZj7ZTKoYHSU4/edit?pli=1#