qrisp.QuantumArray.most_likely#

QuantumArray.most_likely(**kwargs)[source]#

Performs a measurement and returns the most likely outcome.

Parameters:
**kwargsKeyword arguments for the get_measurement call.

Examples

>>> from qrisp import QuantumFloat, QuantumArray, ry
>>> import numpy as np
>>> qa = QuantumArray(QuantumFloat(3), shape = 4)
>>> ry(np.pi*9/8, qa[0][0])
>>> print(qa)
{OutcomeArray([1, 0, 0, 0]): 0.9619, OutcomeArray([0, 0, 0, 0]): 0.0381}
>>> qa.most_likely()
OutcomeArray([1, 0, 0, 0])