https://meetket.quantuloop.com

Ket Quantum Programming

  • Ket — Python-embedded language
  • Libket — Rust runtime-library
  • KBW — Quantum computer simulator

Ket Architecture

Ket Language

The ease of Python in Quantum Programming

Ket by Example
AND gate

def AND(a, b, result):
    with control(a, b):
        X(result)
def AND(a, b, result):
    ctrl(a+b, X, result)

Ket by Example
OR gate

def OR(a, b, result):
    with around(X, a+b):
        AND(a, b, result)
    X(result)

Ket by Example
Grover Diffusion

def diffusion(qubits):
    with around([H, X], qubits):
        ctrl(qubits[1:], Z, qubits[0])

Ket by Example QFT gate

def qft(qubits, invert = True):
    if len(qubits) == 1:
        H(qubits)
    else:
        *head, tail = qubits
        H(tail)
        for i, ctrl_qubit in enumerate(reversed(head)):
            with control(ctrl_qubit):
                phase(pi / 2**(i + 1), tail)
        qft(head, invert=False)

    if invert:
        size = len(qubits)
        for i in range(size // 2):
            swap(qubits[i], qubits[size - i - 1])

Ket by Example
IQFT gate

IQFT = adj(QFT)
with inverse():
    QFT(qubits)

Ket Constructs

  • with control(): Open a controlled-scope
  • ctrl(): Add control-qubits to a Callable
  • with inverse(): Open a inverse scope
  • adj(): Inverse of a Callable
  • with around(): Apply around and

Ket by Example
Measure

a, b, c = H(quant(3))
m_ab = measure(a+b)
m_c  = measure(c)
print(m_ab.value, m_c.value)

Ket by Example
Dump

>>> q = H(quant(2))
>>> d = dump(q)
>>> print(d.show())
|00⟩ (25.00%)
 0.500000        ≅      1/√4
|01⟩ (25.00%)
 0.500000        ≅      1/√4
|10⟩ (25.00%)
 0.500000        ≅      1/√4
|11⟩ (25.00%)
 0.500000        ≅      1/√4

Ket Types

  • quant: Qubit reference list
  • future: Measurement result (from measure())
  • dump: Quantum state

Ket Bitwise Simulator

  • KBW Dense
  • KBW Sparse
only on Ket
Fedora Linux 37, Intel i7-8565U, Ket 0.5.0.1
Fedora Linux 37, Intel i7-8565U, Ket 0.5.0.1

  • Quantuloop Dense — NVIDIA cuQuantum
  • Quantuloop Sparse — Parallel Bitwise
  • Quantuloop QuEST — /QuEST-Kit/QuEST

https://simulator.quantuloop.com

only with Quantuloop

Google Colab, Ubuntu 20.04.5 LTS, NVIDIA Tesla T4, Ket 0.5.0.1

Google Colab, Ubuntu 20.04.5 LTS, NVIDIA Tesla T4, Ket 0.5.0.1

SENAI CIMATEC OGBON, RHEL 7.9, 2x Intel Xeon Gold 6240, 4x NVIDIA Tesla V100 SXM2 32GB, Ket 0.5.0.1

ketteam@quantuloop.com