hybridlane.measurements.state

Classes

StateMP

Interface for all measurements that operate directly on (classically-simulated) statevectors

DensityMatrixMP

Interface for all measurements that operate directly on (classically-simulated) statevectors

Functions

state()

Statevector measurement

density_matrix([wires])

Density matrix measurement

Module Contents

hybridlane.measurements.state.state()[source]

Statevector measurement

Analogous to Pennylane’s state measurement (qp.state()), returning the statevector of the device across all the wires.

Example

>>> circuit() # |1,1>
array([0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 1.-0.j, 0.+0.j, 0.+0.j])
Return type:

StateMP

hybridlane.measurements.state.density_matrix(wires=None)[source]

Density matrix measurement

Analogous to Pennylane’s density matrix measurement (qp.density_matrix()), returning the density matrix of the device across the specified wires. If no wires are specified, returns the density matrix across all wires.

Example

>>> circuit()
array([[0.5   +0.j, 0.0374+0.j],
       [0.0374+0.j, 0.5   +0.j]])
Parameters:

wires (pennylane.wires.WiresLike | None)

Return type:

DensityMatrixMP