Would discuss this with your doctor -- usually thyroid cancer does not cause racing heart but thyroid medication can as well as anxiety about cancer/surgery. We often use medications called beta-blockers (metoprolol, propranolol, atenolol are examples) to help in such situations.
When I was hyperthyroid for a short time my heart would race all day. Until now it races sometimes. If your thyroid is overactive it could Definately be a cause - but perhaps adding to it, are you anxious about the operation in 6 days and may be that's part of it? In any case I wish you luck with your operation and I am very sorry to have read about your loss. Lena