Design and the first experiment of a 1 THz gyrotron