simpleΒΆ

Simple Circuit Case Library (:cls:`qurry.recipe.library.simple`)

catΒΆ

GHZ state (qurry.recipe.library.simple.cat)

The entangled circuit :cls:`GHZ` a.k.a. :cls:`Cat`.

Reference:

Note

  • Measurement of the Entanglement Spectrum of a Symmetry-Protected Topological State

Using the IBM Quantum Computer - Choo, Kenny and von Keyserlingk, Curt W. and Regnault, Nicolas and Neupert, Titus [doi:10.1103/PhysRevLett.121.086808](

}

class qurry.recipe.simple.cat.Cat(num_qubits: int, name: str = 'cat')[source]ΒΆ

:cls:`Cat`, the anthor name of entangled circuit :cls:`GHZ`.

# Open boundary at 8 qubits:
    β”Œβ”€β”€β”€β”
q0: ─ H β”œβ”€β”€β– β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q1: ────── X β”œβ”€β”€β– β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
         β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q2: ─────────── X β”œβ”€β”€β– β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
              β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q3: ──────────────── X β”œβ”€β”€β– β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
                   β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q4: ───────────────────── X β”œβ”€β”€β– β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
                        β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q5: ────────────────────────── X β”œβ”€β”€β– β”€β”€β”€β”€β”€β”€β”€
                             β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q6: ─────────────────────────────── X β”œβ”€β”€β– β”€β”€
                                  β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q7: ──────────────────────────────────── X β”œ
                                       β””β”€β”€β”€β”˜
Parameters:
  • num_qubits (int) – The number of qubits for constructing the example circuit.

  • name (str, optional) – Name of case. Defaults to β€œcat”.

class qurry.recipe.simple.cat.GHZ(num_qubits: int, name: str = 'ghz')[source]ΒΆ

The entangled circuit :cls:`GHZ`. Introduce in https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.121.086808 .

# Open boundary at 8 qubits:
    β”Œβ”€β”€β”€β”
q0: ─ H β”œβ”€β”€β– β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q1: ────── X β”œβ”€β”€β– β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
         β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q2: ─────────── X β”œβ”€β”€β– β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
              β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q3: ──────────────── X β”œβ”€β”€β– β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
                   β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q4: ───────────────────── X β”œβ”€β”€β– β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
                        β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q5: ────────────────────────── X β”œβ”€β”€β– β”€β”€β”€β”€β”€β”€β”€
                             β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q6: ─────────────────────────────── X β”œβ”€β”€β– β”€β”€
                                  β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q7: ──────────────────────────────────── X β”œ
                                       β””β”€β”€β”€β”˜
Parameters:
  • num_qubits (int) – The number of qubits for constructing the example circuit.

  • name (str, optional) – Name of case. Defaults to β€œghz”.

intracellΒΆ

Intracell (qurry.recipe.library.simple.intracell)

class qurry.recipe.simple.intracell.Intracell(num_qubits: int, state: Literal['singlet', 'minus', 'plus'] = 'singlet', name: str = 'intracell')[source]ΒΆ

The entangled circuit :cls:`Intracell`.

# At state `singlet`, `minus` a.k.a. `Singlet` with 8 qubits:
    β”Œβ”€β”€β”€β”β”Œβ”€β”€β”€β”
q0: ─ X β”œβ”€ H β”œβ”€β”€β– β”€β”€
    β”œβ”€β”€β”€β”€β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q1: ─ X β”œβ”€β”€β”€β”€β”€β”€ X β”œ
    β”œβ”€β”€β”€β”€β”Œβ”€β”€β”€β”β””β”€β”€β”€β”˜
q2: ─ X β”œβ”€ H β”œβ”€β”€β– β”€β”€
    β”œβ”€β”€β”€β”€β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q3: ─ X β”œβ”€β”€β”€β”€β”€β”€ X β”œ
    β”œβ”€β”€β”€β”€β”Œβ”€β”€β”€β”β””β”€β”€β”€β”˜
q4: ─ X β”œβ”€ H β”œβ”€β”€β– β”€β”€
    β”œβ”€β”€β”€β”€β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q5: ─ X β”œβ”€β”€β”€β”€β”€β”€ X β”œ
    β”œβ”€β”€β”€β”€β”Œβ”€β”€β”€β”β””β”€β”€β”€β”˜
q6: ─ X β”œβ”€ H β”œβ”€β”€β– β”€β”€
    β”œβ”€β”€β”€β”€β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q7: ─ X β”œβ”€β”€β”€β”€β”€β”€ X β”œ
    β””β”€β”€β”€β”˜     β””β”€β”€β”€β”˜
\[\frac{1}{\sqrt{2}} \left({|01\rangle} - {|10\rangle} \right)^{\otimes N/2}, N = 8\]
# At state `plus` with 8 qubits:
    β”Œβ”€β”€β”€β”
q0: ─ H β”œβ”€β”€β– β”€β”€
    β”œβ”€β”€β”€β”€β”Œβ”€β”΄β”€β”
q1: ─ X β”œβ”€ X β”œ
    β”œβ”€β”€β”€β”€β””β”€β”€β”€β”˜
q2: ─ H β”œβ”€β”€β– β”€β”€
    β”œβ”€β”€β”€β”€β”Œβ”€β”΄β”€β”
q3: ─ X β”œβ”€ X β”œ
    β”œβ”€β”€β”€β”€β””β”€β”€β”€β”˜
q4: ─ H β”œβ”€β”€β– β”€β”€
    β”œβ”€β”€β”€β”€β”Œβ”€β”΄β”€β”
q5: ─ X β”œβ”€ X β”œ
    β”œβ”€β”€β”€β”€β””β”€β”€β”€β”˜
q6: ─ H β”œβ”€β”€β– β”€β”€
    β”œβ”€β”€β”€β”€β”Œβ”€β”΄β”€β”
q7: ─ X β”œβ”€ X β”œ
    β””β”€β”€β”€β”˜β””β”€β”€β”€β”˜
\[\frac{1}{\sqrt{2}} \left({|01\rangle} + {|10\rangle} \right)^{\otimes N/2}, N = 8\]
Parameters:
  • num_qubits (int) – Number of qubits.

  • state (str, optional) – Choosing the state. There are β€˜singlet’, β€˜minus’, β€˜plus’ which β€˜minus’ is same as β€˜singlet’. Defaults to β€œsinglet”.

  • name (str, optional) – Name of case. Defaults to β€œintracell”.

property state: Literal['singlet', 'minus', 'plus']ΒΆ

The state of the circuit.

Returns:

The state of the circuit.

class qurry.recipe.simple.intracell.Singlet(num_qubits: int, name: str = 'singlet')[source]ΒΆ

:cls:`Siglet`, the entangled circuit :cls:`Intracell` with singlet state.

# At 8 qubits:
    β”Œβ”€β”€β”€β”β”Œβ”€β”€β”€β”
q0: ─ X β”œβ”€ H β”œβ”€β”€β– β”€β”€
    β”œβ”€β”€β”€β”€β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q1: ─ X β”œβ”€β”€β”€β”€β”€β”€ X β”œ
    β”œβ”€β”€β”€β”€β”Œβ”€β”€β”€β”β””β”€β”€β”€β”˜
q2: ─ X β”œβ”€ H β”œβ”€β”€β– β”€β”€
    β”œβ”€β”€β”€β”€β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q3: ─ X β”œβ”€β”€β”€β”€β”€β”€ X β”œ
    β”œβ”€β”€β”€β”€β”Œβ”€β”€β”€β”β””β”€β”€β”€β”˜
q4: ─ X β”œβ”€ H β”œβ”€β”€β– β”€β”€
    β”œβ”€β”€β”€β”€β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q5: ─ X β”œβ”€β”€β”€β”€β”€β”€ X β”œ
    β”œβ”€β”€β”€β”€β”Œβ”€β”€β”€β”β””β”€β”€β”€β”˜
q6: ─ X β”œβ”€ H β”œβ”€β”€β– β”€β”€
    β”œβ”€β”€β”€β”€β””β”€β”€β”€β”˜β”Œβ”€β”΄β”€β”
q7: ─ X β”œβ”€β”€β”€β”€β”€β”€ X β”œ
    β””β”€β”€β”€β”˜     β””β”€β”€β”€β”˜
\[\frac{1}{\sqrt{2}} \left({|01\rangle} - {|10\rangle} \right)^{\otimes N/2}, N = 8\]
Parameters:
  • num_qubits (int) – Number of qubits.

  • name (str, optional) – Name of case. Defaults to β€œsinglet”.

Raises:

ValueError – When given number of qubits is not even.

paramagnetΒΆ

Paramagnet (qurry.recipe.library.simple.paramagnet)

The circuits :cls:`TrivialParamagnet` and :cls:`TopologicalParamagnet`.

Reference:

Note

  • Measurement of the Entanglement Spectrum of a Symmetry-Protected Topological State

Using the IBM Quantum Computer - Choo, Kenny and von Keyserlingk, Curt W. and Regnault, Nicolas and Neupert, Titus [doi:10.1103/PhysRevLett.121.086808](

}

class qurry.recipe.simple.paramagnet.Cluster(num_qubits: int, border_cond: Literal['open', 'period'] = 'period', name: str = 'cluster')[source]ΒΆ

:cls:`Cluster`, another name of The entangled circuit :cls:`Topological paramagnet`. Introduce in https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.121.086808 .

# With ACTUAL `CZGate`, Open boundary at 8 qubits:
    β”Œβ”€β”€β”€β”
q0: ─ H β”œβ”€β– β”€β”€β”€β”€
    β”œβ”€β”€β”€β”€ β”‚
q1: ─ H β”œβ”€β– β”€β”€β– β”€
    β”œβ”€β”€β”€β”€    β”‚
q2: ─ H β”œβ”€β– β”€β”€β– β”€
    β”œβ”€β”€β”€β”€ β”‚
q3: ─ H β”œβ”€β– β”€β”€β– β”€
    β”œβ”€β”€β”€β”€    β”‚
q4: ─ H β”œβ”€β– β”€β”€β– β”€
    β”œβ”€β”€β”€β”€ β”‚
q5: ─ H β”œβ”€β– β”€β”€β– β”€
    β”œβ”€β”€β”€β”€    β”‚
q6: ─ H β”œβ”€β– β”€β”€β– β”€
    β”œβ”€β”€β”€β”€ β”‚
q7: ─ H β”œβ”€β– β”€β”€β”€β”€
    β””β”€β”€β”€β”˜
# With ACTUAL `CZGate`, Period boundary at 8 qubits:
    β”Œβ”€β”€β”€β”
q0: ─ H β”œβ”€β– β”€β”€β”€β”€β”€β– β”€
    β”œβ”€β”€β”€β”€ β”‚     β”‚
q1: ─ H β”œβ”€β– β”€β”€β– β”€β”€β”Όβ”€
    β”œβ”€β”€β”€β”€    β”‚  β”‚
q2: ─ H β”œβ”€β– β”€β”€β– β”€β”€β”Όβ”€
    β”œβ”€β”€β”€β”€ β”‚     β”‚
q3: ─ H β”œβ”€β– β”€β”€β– β”€β”€β”Όβ”€
    β”œβ”€β”€β”€β”€    β”‚  β”‚
q4: ─ H β”œβ”€β– β”€β”€β– β”€β”€β”Όβ”€
    β”œβ”€β”€β”€β”€ β”‚     β”‚
q5: ─ H β”œβ”€β– β”€β”€β– β”€β”€β”Όβ”€
    β”œβ”€β”€β”€β”€    β”‚  β”‚
q6: ─ H β”œβ”€β– β”€β”€β– β”€β”€β”Όβ”€
    β”œβ”€β”€β”€β”€ β”‚     β”‚
q7: ─ H β”œβ”€β– β”€β”€β”€β”€β”€β– β”€
    β””β”€β”€β”€β”˜
Parameters:
  • num_qubits (int) – Number of qubits.

  • border_cond (str, optional) – Boundary condition is open or period. Defaults to β€œperiod”.

  • name (str, optional) – Name of case. Defaults to β€œcluster”.

Raises:

ValueError – When given number of qubits is not even.

class qurry.recipe.simple.paramagnet.TopologicalParamagnet(num_qubits: int, border_cond: Literal['open', 'period'] = 'period', name: str = 'cluster')[source]ΒΆ

The entangled circuit :cls:`Topological paramagnet`. Introduce in https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.121.086808 .

# With ACTUAL CZGate, Open boundary at 8 qubits:
    β”Œβ”€β”€β”€β”
q0: ─ H β”œβ”€β– β”€β”€β”€β”€
    β”œβ”€β”€β”€β”€ β”‚
q1: ─ H β”œβ”€β– β”€β”€β– β”€
    β”œβ”€β”€β”€β”€    β”‚
q2: ─ H β”œβ”€β– β”€β”€β– β”€
    β”œβ”€β”€β”€β”€ β”‚
q3: ─ H β”œβ”€β– β”€β”€β– β”€
    β”œβ”€β”€β”€β”€    β”‚
q4: ─ H β”œβ”€β– β”€β”€β– β”€
    β”œβ”€β”€β”€β”€ β”‚
q5: ─ H β”œβ”€β– β”€β”€β– β”€
    β”œβ”€β”€β”€β”€    β”‚
q6: ─ H β”œβ”€β– β”€β”€β– β”€
    β”œβ”€β”€β”€β”€ β”‚
q7: ─ H β”œβ”€β– β”€β”€β”€β”€
    β””β”€β”€β”€β”˜
# With ACTUAL CZGate, Open boundary at 5 qubits:
    β”Œβ”€β”€β”€β”
q0: ─ H β”œβ”€β– β”€β”€β”€β”€
    β”œβ”€β”€β”€β”€ β”‚
q1: ─ H β”œβ”€β– β”€β”€β– β”€
    β”œβ”€β”€β”€β”€    β”‚
q2: ─ H β”œβ”€β– β”€β”€β– β”€
    β”œβ”€β”€β”€β”€ β”‚
q3: ─ H β”œβ”€β– β”€β”€β– β”€
    β”œβ”€β”€β”€β”€    β”‚
q4: ─ H β”œβ”€β”€β”€β”€β– β”€
    β””β”€β”€β”€β”˜
# With ACTUAL CZGate, Period boundary at 8 qubits:
    β”Œβ”€β”€β”€β”
q0: ─ H β”œβ”€β– β”€β”€β”€β”€β”€β– β”€
    β”œβ”€β”€β”€β”€ β”‚     β”‚
q1: ─ H β”œβ”€β– β”€β”€β– β”€β”€β”Όβ”€
    β”œβ”€β”€β”€β”€    β”‚  β”‚
q2: ─ H β”œβ”€β– β”€β”€β– β”€β”€β”Όβ”€
    β”œβ”€β”€β”€β”€ β”‚     β”‚
q3: ─ H β”œβ”€β– β”€β”€β– β”€β”€β”Όβ”€
    β”œβ”€β”€β”€β”€    β”‚  β”‚
q4: ─ H β”œβ”€β– β”€β”€β– β”€β”€β”Όβ”€
    β”œβ”€β”€β”€β”€ β”‚     β”‚
q5: ─ H β”œβ”€β– β”€β”€β– β”€β”€β”Όβ”€
    β”œβ”€β”€β”€β”€    β”‚  β”‚
q6: ─ H β”œβ”€β– β”€β”€β– β”€β”€β”Όβ”€
    β”œβ”€β”€β”€β”€ β”‚     β”‚
q7: ─ H β”œβ”€β– β”€β”€β”€β”€β”€β– β”€
    β””β”€β”€β”€β”˜
# With ACTUAL CZGate, Period boundary at 5 qubits:
    β”Œβ”€β”€β”€β”
q0: ─ H β”œβ”€β– β”€β”€β– β”€β”€β”€β”€
    β”œβ”€β”€β”€β”€ β”‚  β”‚
q1: ─ H β”œβ”€β– β”€β”€β”Όβ”€β”€β– β”€
    β”œβ”€β”€β”€β”€    β”‚  β”‚
q2: ─ H β”œβ”€β– β”€β”€β”Όβ”€β”€β– β”€
    β”œβ”€β”€β”€β”€ β”‚  β”‚
q3: ─ H β”œβ”€β– β”€β”€β”Όβ”€β”€β– β”€
    β”œβ”€β”€β”€β”€    β”‚  β”‚
q4: ─ H β”œβ”€β”€β”€β”€β– β”€β”€β– β”€
    β””β”€β”€β”€β”˜
Parameters:
  • num_qubits (int) – Number of qubits.

  • border_cond (str, optional) – Boundary condition is open or period. Defaults to β€œperiod”.

  • name (str, optional) – Name of case. Defaults to β€œcluster”.

Raises:

ValueError – When given number of qubits is not even.

property border_cond: Literal['open', 'period']ΒΆ

The border condition.

class qurry.recipe.simple.paramagnet.TrivialParamagnet(num_qubits: int, name: str = 'trivial_paramagnet')[source]ΒΆ

The product state circuit :cls:`TrivialParamagnet`. Introduce in https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.121.086808 .

# At 8 qubits:
    β”Œβ”€β”€β”€β”
q0: ─ H β”œ
    β”œβ”€β”€β”€β”€
q1: ─ H β”œ
    β”œβ”€β”€β”€β”€
q2: ─ H β”œ
    β”œβ”€β”€β”€β”€
q3: ─ H β”œ
    β”œβ”€β”€β”€β”€
q4: ─ H β”œ
    β”œβ”€β”€β”€β”€
q5: ─ H β”œ
    β”œβ”€β”€β”€β”€
q6: ─ H β”œ
    β”œβ”€β”€β”€β”€
q7: ─ H β”œ
    β””β”€β”€β”€β”˜
\[{|+\rangle}^{\otimes N}, N = 8\]
Parameters:
  • num_qubits (int) – Number of qubits.

  • name (str, optional) – Name of case. Defaults to β€œtrivial_paramagnet”.