How to take care of charge neutrality

Hi.
I am new to amazing Gulp code.
In a simple run, I had used the program with a set of parameters obtained for a stoichiometric system. One parameter is the “charge” of core and shell which sums to zero for stoichiometric unit cell.
I tried to add one more constituent atom to the unit cell which destroys the charge-neutrality of the unit cell and the code complains.
I have read the help file and found keywords of “defect”, and included the coordinates of the addend atom after the last line of positions for stoichiometric system. The code starts working but I am not sure if I did the right choice.
I would greatly appreciate any help.
Bests
Mahmoud

Hi Mahmoud,
Thanks for your kind remark - glad you like GULP.
You can allow systems to be non-charge neutral by adding the keyword “qok”.
The reason that the user has to do this is that bad things can happen if you have periodic charged systems & it’s important to understand the issues around Ewald sums and infinitely charged materials before proceeding further as care is needed.
Regards,
Julian

Dear Julian,
Thank you for your comments and solution to the problem.
But, the main issue to me is that these charges are system-dependent. As I followed in the user-guide, the best choice is Born charges (and maybe not Lowdin). In ab-initio results, I notice that the values of these Born charges depend on the number of atoms and the species, BUT always they are so distributed that the sum of charges add to zero. This means for me that the core and shell charges are parameters that should be re-determined for any new system, and therefore leading to zero total charge.
Does the “qok” keyword re-parametrize the charges for any new system?
Thank you so much for your comments.
Bests,
Mahmoud

Dear Mahmoud
The choice of charges is down to the user as it depends on the force field they are using from the literature, or alternatively if they are fitting their own force field it depends on the results of the fitting process. “qok” is just for allowing non-charge neutral solids to be run, provided the user knows what they are doing.
Regards,
Julian

Dear Julian,
Thank you so much for your time and comments.
I am now convinced.
Best regards,
Mahmoud