The word deterrent used in the sense of the justice system works like this:
If mandatory minimums kick in at 100 plants I will be more likely to stay below that number.
The punishment acts as a preventative method. It compels me to avoid commit the crime.
Deterrents act as a preventative method to make sure that EVERYONE, not one person does not commit crimes.
You seem to be hung up on this part. Executions do not serve as a deterrent, they definitely serve as a method of preventing reoffense of crime.
A deterrent no.
A means of preventing reoffending, yes.
They are different concepts.
A state killing murderers does not reduce the amount of homicides that occur.
These concepts are separate and may not be applied over the other. A punishment may be a deterrent but it is not guaranteed. A deterrent will almost always be a punishment.
Are you digging man?