It is only done in China, Japan, the United States, Germany, and Italy. Since some of the newer semiconductors are shaped at 99.9999999999% (literally, 10 9s) pure, only a few places in the world can do the purification. China, and only China, can do 99.9999999 (Seven 9s) at scale, which is good enough for solar panels.
The process is more complex and the energy more intense the more 9’s you need, because the contaminates in quartz are different depending on where it was mined. This complexity is why there’s only one place in the world that can do it at solar panel demand scale — and that’s because China dumped a ton of money into the process and doesn’t have strict pollution laws. If you can start with purer quartz, you’re way ahead of reaching scalable refinement.
I just assumed they had processes for eliminating any and all contaminants.