It is best to apply for an invention patent before the paper is published. After the publication of the paper, it is basically impossible to apply for a patent. Your thesis is used as a comparative document of your patent application, which makes your patent basically unable to be authorized.
After you apply (submit an application), you can write and quote in your paper without affecting your patent authorization. Good luck.