qutip_qip.pulse

Pulse representation of a quantum circuit.

Classes

Drift([qobj])

Representation of the time-independent drift Hamiltonian.

Pulse(qobj, targets[, tlist, coeff, ...])

Representation of a control pulse and the pulse dependent noise.

class qutip_qip.pulse.Drift(qobj=None)[source]

Bases: object

Representation of the time-independent drift Hamiltonian. Usually its the intrinsic evolution of the quantum system that can not be tuned.

Parameters
qobjqutip.Qobj or list of qutip.Qobj, optional

The drift Hamiltonians.

Attributes
qobj: list ofclass:qutip.Qobj

A list of the the drift Hamiltonians.

add_drift(qobj, targets)[source]

Add a Hamiltonian to the drift.

Parameters
qobj:class:qutip.Qobj

The collapse operator of the lindblad noise.

targets: list

target qubits of the collapse operator (or subquantum system of other dimensions).

get_full_tlist()[source]

Drift has no tlist, this is just a place holder to keep it unified with Pulse. It returns None.

get_ideal_qobjevo(dims)[source]

Get the QobjEvo representation of the drift Hamiltonian.

Parameters
dims: int or list

Dimension of the system. If int, we assume it is the number of qubits in the system. If list, it is the dimension of the component systems.

Returns
ideal_evo:class:qutip.QobjEvo

A QobjEvo representing the drift evolution.

get_noisy_qobjevo(dims)[source]

Same as the get_ideal_qobjevo method. There is no additional noise for the drift evolution.

Returns
noisy_evo:class:qutip.QobjEvo

A QobjEvo representing the ideal evolution and coherent noise.

c_ops: list ofclass:qutip.QobjEvo

Always an empty list for Drift

class qutip_qip.pulse.Pulse(qobj, targets, tlist=None, coeff=None, spline_kind='step_func', label='')[source]

Bases: object

Representation of a control pulse and the pulse dependent noise. The pulse is characterized by the ideal control pulse, the coherent noise and the lindblad noise. The later two are lists of noisy evolution dynamics. Each dynamic element is characterized by four variables: qobj, targets, tlist and coeff.

See examples for different construction behavior.

Parameters
qobjqutip.Qobj

The Hamiltonian of the ideal pulse.

targets: list

target qubits of the ideal pulse (or subquantum system of other dimensions).

tlist: array-like, optional

Time sequence of the ideal pulse. A list of time at which the time-dependent coefficients are applied. tlist does not have to be equidistant, but must have the same length or one element shorter compared to coeff. See documentation for the parameter spline_kind.

coeff: array-like or bool, optional

Time-dependent coefficients of the ideal control pulse. If an array, the length must be the same or one element longer compared to tlist. See documentation for the parameter spline_kind. If a bool, the coefficient is a constant 1 or 0.

spline_kind: str, optional

Type of the coefficient interpolation: “step_func” or “cubic”.

-“step_func”: The coefficient will be treated as a step function. E.g. tlist=[0,1,2] and coeff=[3,2], means that the coefficient is 3 in t=[0,1) and 2 in t=[2,3). It requires len(coeff)=len(tlist)-1 or len(coeff)=len(tlist), but in the second case the last element of coeff has no effect.

-“cubic”: Use cubic interpolation for the coefficient. It requires len(coeff)=len(tlist)

label: str

The label (name) of the pulse.

Examples

Create a pulse that is turned off

>>> Pulse(sigmaz(), 0) 
>>> Pulse(sigmaz(), 0, None, None) 

Create a time dependent pulse

>>> tlist = np.array([0., 1., 2., 4.]) 
>>> coeff = np.array([0.5, 1.2, 0.8]) 
>>> spline_kind = "step_func" 
>>> Pulse(sigmaz(), 0, tlist=tlist, coeff=coeff, spline_kind="step_func") 

Create a time independent pulse

>>> Pulse(sigmaz(), 0, coeff=True) 

Create a constant pulse with time range

>>> Pulse(sigmaz(), 0, tlist=tlist, coeff=True) 

Create an dummy Pulse (H=0)

>>> Pulse(None, None) 
Attributes
ideal_pulse:class:.pulse._EvoElement

The ideal dynamic of the control pulse.

coherent_noise: list ofclass:.pulse._EvoElement

The coherent noise caused by the control pulse. Each dynamic element is still characterized by a time-dependent Hamiltonian.

lindblad_noise: list ofclass:.pulse._EvoElement

The dissipative noise of the control pulse. Each dynamic element will be treated as a (time-dependent) lindblad operator in the master equation.

spline_kind: str

See parameter spline_kind.

label: str

See parameter label.

add_coherent_noise(qobj, targets, tlist=None, coeff=None)[source]

Add a new (time-dependent) Hamiltonian to the coherent noise.

Parameters
qobj:class:qutip.Qobj

The Hamiltonian of the pulse.

targets: list

target qubits of the pulse (or subquantum system of other dimensions).

tlist: array-like, optional

A list of time at which the time-dependent coefficients are applied. tlist does not have to be equidistant, but must have the same length or one element shorter compared to coeff. See documentation for the parameter spline_kind of Pulse.

coeff: array-like or bool, optional

Time-dependent coefficients of the pulse noise. If an array, the length must be the same or one element longer compared to tlist. See documentation for the parameter spline_kind of Pulse. If a bool, the coefficient is a constant 1 or 0.

add_lindblad_noise(qobj, targets, tlist=None, coeff=None)[source]

Add a new (time-dependent) lindblad noise to the coherent noise.

Parameters
qobj:class:qutip.Qobj

The collapse operator of the lindblad noise.

targets: list

target qubits of the collapse operator (or subquantum system of other dimensions).

tlist: array-like, optional

A list of time at which the time-dependent coefficients are applied. tlist does not have to be equidistant, but must have the same length or one element shorter compared to coeff. See documentation for the parameter spline_kind of Pulse.

coeff: array-like or bool, optional

Time-dependent coefficients of the pulse noise. If an array, the length must be the same or one element longer compared to tlist. See documentation for the parameter spline_kind of Pulse. If a bool, the coefficient is a constant 1 or 0.

property coeff

See parameter coeff.

get_full_tlist(tol=1e-10)[source]

Return the full tlist of the pulses and noise. It means that if different tlist are present, they will be merged to one with all time points stored in a sorted array.

Returns
full_tlist: array-like 1d

The full time sequence for the noisy evolution.

get_ideal_qobj(dims)[source]

Get the Hamiltonian of the ideal pulse.

Parameters
dims: int or list

Dimension of the system. If int, we assume it is the number of qubits in the system. If list, it is the dimension of the component systems.

Returns
qobjqutip.Qobj

The Hamiltonian of the ideal pulse.

get_ideal_qobjevo(dims)[source]

Get a QobjEvo representation of the ideal evolution.

Parameters
dims: int or list

Dimension of the system. If int, we assume it is the number of qubits in the system. If list, it is the dimension of the component systems.

Returns
ideal_evo:class:qutip.QobjEvo

A QobjEvo representing the ideal evolution.

get_noisy_qobjevo(dims)[source]

Get the QobjEvo representation of the noisy evolution. The result can be used directly as input for the qutip solvers.

Parameters
dims: int or list

Dimension of the system. If int, we assume it is the number of qubits in the system. If list, it is the dimension of the component systems.

Returns
noisy_evo:class:qutip.QobjEvo

A QobjEvo representing the ideal evolution and coherent noise.

c_ops: list ofclass:qutip.QobjEvo

A list of (time-dependent) lindbald operators.

print_info()[source]

Print the information of the pulse, including the ideal dynamics, the coherent noise and the lindblad noise.

property qobj

See parameter qobj.

property targets

See parameter targets.

property tlist

See parameter tlist