German
Sprachen
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

qiskit.quantum_info.SparsePauliOp.chop

SparsePauliOp.chop(tol=1e-14)[Quellcode]

Set real and imaginary parts of the coefficients to 0 if < tol in magnitude.

For example, the operator representing 1+1e-17j X + 1e-17 Y with a tolerance larger than 1e-17 will be reduced to 1 X whereas SparsePauliOp.simplify() would return 1+1e-17j X.

If a both the real and imaginary part of a coefficient is 0 after chopping, the corresponding Pauli is removed from the operator.

Parameter

tol (float) – The absolute tolerance to check whether a real or imaginary part should be set to 0.

Rückgabe

This operator with chopped coefficients.

Rückgabetyp

SparsePauliOp