Codes for modeling lasers