Muscle contraction

when i wake up from a long sleep the operated hip muscle goes into spasm, it is quite painful as i need to stretch it ,has anyone else had this

Sorry your having pain and muscle issues. when was your surgery? Muscle pain seems to be common for many while recovering. Many muscles have to adjust from old joint removed and new components to replace the joint. Before surgery the muscles were holding the old position of the joint with little help from bone. The pressure from surgery adding new joint implant components and new positioning of the whole joint and areas surrounding,all has a impact on the joint. It takes many months to build up strength . I have had three THR over the years and each recovery is different.

To heal from surgery on average takes almost a full year or more for complete recovery . Walking is the best treatment for muscle aches and slowly build up tolerance . Muscle memory is starting over with new position as the brain and body adjust and use the new joint components. The use of the whole new joint is very different .

Of course the goal of THR is mobility and hips heal quite well on their own. Slowly just walking no special exercises in my case over time helped by increasing stability and endurance. Sometimes over doing can have painful muscle issues. Try massager, heat , ice, magnesium sprays, or OTC pain patches to sleep . The pain patch is a great healing tool especially for sleep at night. Also very important to eat well, rest daily, take vitamins and protein shakes helped me build up strength and endurance .
sending healing blessing your way.