quilc icon indicating copy to clipboard operation
quilc copied to clipboard

"IDENTITY" initial rewiring strategy

Open notmgsk opened this issue 4 years ago • 1 comments

The "NAIVE" initial rewiring strategy tries to avoid rewiring qubits, but will if there is a 2Q instruction that cannot be enacted on the provided qubits:

QUIL> (print-parsed-program
       (compiler-hook (parse "PRAGMA INITIAL_REWIRING \"NAIVE\"; CZ 0 2")
                      chip))
PRAGMA INITIAL_REWIRING "NAIVE"
CZ 1 2                                  # Entering rewiring: #(1 0 2 3)
HALT                                    # Exiting rewiring: #(1 0 2 3)

It may be useful to also have a strategy that strictly adheres to an identity map between logical and physical qubits:

QUIL> (print-parsed-program
       (compiler-hook (parse "PRAGMA INITIAL_REWIRING \"IDENTITY\"; CZ 0 2")
                      chip))
PRAGMA INITIAL_REWIRING "IDENTITY"
RZ(-2.5488357645048048) 0               # Entering rewiring: #(0 1 2 3)
RX(pi/2) 0
RZ(2.079807667586275) 0
RX(-pi/2) 0
RZ(-2.2709115010202283) 1
RX(pi/2) 1
RZ(2.5039458858335597) 1
RX(-pi/2) 1
CZ 1 0
RZ(1.4358710688580993) 0
RX(pi/2) 0
RZ(-1.5173734837788224) 1
RX(-pi/2) 1
CZ 1 0
RX(-pi/2) 0
RX(pi/2) 1
CZ 1 0
RZ(1.807326329153546) 1
RX(pi/2) 1
RZ(0.5250671103423779) 1
RX(-pi/2) 1
CZ 1 2
RZ(-1.6103374643670643) 0
RX(pi/2) 0
RZ(0.9342061478727135) 0
RX(-pi/2) 0
RZ(-0.8042280573284075) 0
RZ(-0.8644370089703486) 1
HALT                                    # Exiting rewiring: #(1 0 2 3)

notmgsk avatar Jun 12 '20 21:06 notmgsk

I propose calling it PROGRAM, RIGID, STATIC, or FIXED, not because IDENTITY is bad (it's not; it's a great name and fits well with the permutation representation), but because IDENTITY is an overloaded word and doesn't describe the rewiring strategy so much as it describes the trivial rewiring result.

stylewarning avatar Jul 23 '20 20:07 stylewarning