normalize_check {qvirus} | R Documentation |
Check the normalization of a qstate object created by qsimulatR package.
normalize_check(qstate_obj, probs = FALSE)
qstate_obj |
A quantum state object. |
probs |
Are probabilities required as output? |
Either the sum of the squared magnitudes of the coefficients of the qstate object or its probabilities.
library(qsimulatR)
ket0 <- qstate(nbits = 1)
normalize_check(ket0)