This article focuses on the optimization of the layout of a tidal current turbine array (TCTA) using the Quantum Discrete Particle Swarm (QDPS) algorithm. The objective of the optimization is to balance the maximum energy output and minimum levelized cost of energy (LCOE). The optimization model proposed in this paper was constructed by combining a computational tidal model and the QDPS algorithm, which incorporate several advancements, including modeling of underwater terrain, obtaining tidal current field using high-fidelity ocean model, considering turbine properties, formulating partial influence of wakes on turbines, accounting for interactions between multiple wakes, modeling of safe operating distance, developing an LCOE model, and computing the sea space utilization area of a tidal farm. The proposed method was applied to optimize the layout of TCTA in a real waterway, which employed maximum tidal current fields during flooding and ebbing periods of spring tides as input for safety reasons. The results indicate that compared to a regular staggered layout, the total power generation improved by 19% and 16%, and the LCOE reduced by 12% and 15%, respectively, when the concluded optimized layout was utilized. Sea area decreased by 24% when LCOE was minimum. Overall, the proposed method has a better performance and can support the set selection as well as turbines placements of tidal current farms.