This paper introduces DECOMPOPT, a structure-based molecular optimization method based on a controllable and decomposed diffusion model. The method combines optimization with conditional diffusion models to achieve desired properties while adhering to molecular grammar. DECOMPOPT offers a unified framework for both de novo design and controllable generation. Ligands are decomposed into substructures, allowing fine-grained control and local optimization. Experiments show that DECOMPOPT can efficiently generate molecules with improved properties compared to strong de novo baselines and demonstrate great potential in controllable generation tasks. The method is particularly effective in scenarios such as R-group design and scaffold hopping, where flexible controllability is required. DECOMPOPT achieves a high success rate in generating molecules with desired properties, including high binding affinity, synthetic accessibility, and drug-likeness. The method also shows promising results in terms of molecular diversity and the ability to explore novel chemical space. The paper also presents ablation studies and comparisons with other baselines, demonstrating the effectiveness of the decomposed optimization approach. Overall, DECOMPOPT provides a new paradigm for structure-based molecular optimization that combines the strengths of generative models and optimization algorithms.This paper introduces DECOMPOPT, a structure-based molecular optimization method based on a controllable and decomposed diffusion model. The method combines optimization with conditional diffusion models to achieve desired properties while adhering to molecular grammar. DECOMPOPT offers a unified framework for both de novo design and controllable generation. Ligands are decomposed into substructures, allowing fine-grained control and local optimization. Experiments show that DECOMPOPT can efficiently generate molecules with improved properties compared to strong de novo baselines and demonstrate great potential in controllable generation tasks. The method is particularly effective in scenarios such as R-group design and scaffold hopping, where flexible controllability is required. DECOMPOPT achieves a high success rate in generating molecules with desired properties, including high binding affinity, synthetic accessibility, and drug-likeness. The method also shows promising results in terms of molecular diversity and the ability to explore novel chemical space. The paper also presents ablation studies and comparisons with other baselines, demonstrating the effectiveness of the decomposed optimization approach. Overall, DECOMPOPT provides a new paradigm for structure-based molecular optimization that combines the strengths of generative models and optimization algorithms.