Reconfigurable intelligent surface (RIS) can establish links to enhance communication performance of in terahertz wireless communication with non-line-of-sight (NLoS). By adjusting the phase and amplitude of the incident wave, arbitrary beam pattern can be obtained to adapt to different application scenarios. This paper studies arbitrary beamforming under the situations that RIS can only adjust the phase of the reflection beam. Then, we consider the reflection coefficient of RIS is under discrete modulus constraint (DMC), which means the amplitude of reflection coefficient can be 0 or 1. And the phase of the reflection coefficient is continuous. Numerical simulations show that discrete modulus constraint has better performance than just adjusting the phase. Moreover, only a portion of RIS units in DMC is working, which means that DMC has higher energy efficiency.