Using DSM and LDPC coding, we successfully achieved error-free transmission for the PDM-1024QAM signal and high-quality transmission for the 2048QAM signal in the 400G photonic-assisted terahertz communication system. Without using LDPC, the BER of 1024-QAM signals can be reduced to 3.8e-3, while the BERs for 2048-QAM and 4096-QAM signals can be decreased to below 4.2e-2. When LDPC is employed for error correction, 1024-QAM signals achieve error-free transmission, and the BER of 2048-QAM signals can be further reduced to 9.8e-5.