qat.hardware.GatesSpecification

class qat.hardware.GatesSpecification(gate_times, quantum_channels, state_prep=None, meas=None)

A GatesSpecification specifies the gates of a quantum hardware (independently of its environment).

Parameters
  • gate_times (dict<str, float> or dict<str, dict<tuple<int>, float>> or dict<str, lambda<param, float>> or dict<str, dict<tuple<int>, lambda<param, float>>) – contains duration (possibly parametric) of each gate (possibly qubit-wise)

  • quantum_channels (dict<str, QuantumChannel> or dict<str, lambda<param, QuantumChannel>> or dict<str, dict<qbits, QuantumChannel>> or dict<str, dict<qbits, lambda<param, QuantumChannel>>>) – dictionary containing the quantum channels describing each gate

  • state_prep (array or dict<int, array>, optional) – array describing initial state of register \(\rho_0\) as matrix in computational basis. Defaults to None (perfect initialization, \(\rho_0 = |0\rangle \langle 0|\)).

  • meas (array or dict<int, array>, optional) – array \(E\) defining the measurement operation. The measurement operation is a two-outcome POVM \(\lbrace I - E, E \rbrace\) with two outcomes 0 and 1. Thus, \(p(0) = \mathrm{Tr}\left[\rho (I - E) \right]\) and \(p(1)=\mathrm{Tr}\left[ \rho E \right]\). Defaults to None (perfect measurement, \(|1\rangle \langle 1|\)).

gate_times

contains duration (possibly parametric) of each gate (possibly qubit-wise)

Type

dict<str, float> or dict<str, dict<tuple<int>, float>> or dict<str, lambda<param, float>> or dict<str, dict<tuple<int>, lambda<param, float>>

quantum_channels

dictionary containing the quantum channels describing each gate

Type

dict<str, QuantumChannel> or dict<str, lambda<param, QuantumChannel>> or dict<str, dict<qbits, QuantumChannel>> or dict<str, dict<qbits, lambda<param, QuantumChannel>>>

state_prep

array describing initial state of register \(\rho_0\) as matrix in computational basis.

Type

array or dict<int, array>, optional

meas

array \(E\) defining the measurement operation. The measurement operation is a two-outcome POVM \(\lbrace I - E, E \rbrace\) with two outcomes 0 and 1. Thus, \(p(0) = \mathrm{Tr}\left[\rho (I - E) \right]\) and \(p(1)=\mathrm{Tr}\left[ \rho E \right]\).

Type

array or dict<int, array>, optional

get_gate_time(gate_type, qbits, *args, **kwargs)

Get time of a specific gate and qubit

Parameters
  • gate_type (string) – type of gate (e.g “H”, “RZ”, …)

  • qbits (tuple) – indices of qbits

Returns

the gate time for the given qubits

Note

Also works if gate time is the same for each qubit/qubit pair etc.

get_quantum_channel(gate_type, qbits, *args, gate_dic=None, key=None, **kwargs)

Get noise channel of a specific gate and qubit

Parameters
  • gate_type (string) – type of the gate (e.g “H”, “RZ”,…)

  • qbits (tuple) – qbits on which gate is applied

Returns

the channel corresponding to the gate

Return type

QuantumChannelKraus