R/bra.R

Defines functions bra

Documented in bra

#' @export
bra <- function(...){
	coeff <- as.complex(list(...))
	if(Im(coeff[1]) > 0)
		coeff <- coeff / coeff[1]
	coeff <- coeff/sqrt(sum(abs(coeff)^2))
	if(Re(coeff[1]) < 0)
		coeff <- coeff * -1
	matrix(coeff,nrow=1)
}

Try the QuantumOps package in your browser

Any scripts or data that you put into this service are public.

QuantumOps documentation built on Feb. 3, 2020, 5:07 p.m.