ket.npsim

Live Execution Simulator Based on NumPy

This simulator is available as a demonstration of the LiveExecution class for constructing live execution targets using Python. It is not intended to be a high-performance simulator. For better performance, use the KBW simulator.

Classes ket.npsim

NPSim

NumPy based Live Execution simulator.

class NPSim(num_qubits)

NumPy based Live Execution simulator.

Parameters:

num_qubits – number of qubits.

connect()

Call configure with the appropriated arguments to generate the object.

pauli_x(target, control)

Apply a Pauli-X gate to the target qubit.

pauli_y(target, control)

Apply a Pauli-Y gate to the target qubit.

pauli_z(target, control)

Apply a Pauli-Z gate to the target qubit.

hadamard(target, control)

Apply a Hadamard gate to the target qubit.

rotation_x(target, control, angle)

Apply a X-Rotation gate to the target qubit.

rotation_y(target, control, angle)

Apply a Y-Rotation gate to the target qubit.

rotation_z(target, control, angle)

Apply a Z-Rotation gate to the target qubit.

phase(target, control, angle)

Apply a Phase gate to the target qubit.

measure(qubits: list[int]) int

Measure the qubits and return the result as an integer.

dump(qubits: list[int]) dict

Dump the state of the qubits.