And you do not know what you are talking about.
Let us take the American Mk46 torpedo for example.
en.wikipedia.org
Note the warhead of explosive weight: 100 lbs or 45 kg. Remember, am using this only an example.
Explosions are like electricity and pressurized gas/water: seek out the path of least resistance.
An explosion from 45 kg warhead will sink a submarine but against a carrier it will not even qualify as a mosquito bite. Forty five kg would damage a destroyer, maybe even make a 'mission kill', or delay a heavy cruiser, but will do nothing against a carrier except scratch the paint and dent the hull a wee bit.
So is the answer a heavier torpedo? Yes. But submarines are designed to be mission specific. How many larger torpedoes? What are their weight/yield class? Different torpedo yield may have different sizes, so does that mean different torpedo tube sizes? And there are many more design questions.
It is not impossible for a sub to sink an aircraft carrier, but this is not WW II era ships. WW II era carriers were
CONVERTERS meaning the hulls were cruisers or even oilers converted into aircraft carriers. Today's aircraft carrier hulls are in a different class of design, engineering, and construction. So if a sub with torpedo yields like the Mk46 want to sink a carrier, the carrier will have to sit still and let 100+ torpedoes to do their jobs. Further, subs cannot 'chase' or 'stalk' ships. Submerged, a sub can match a surface vessel in speed but the hull noise would give the sub away. That make all subs 'ambush predators', meaning a sub would have to position itself ahead of the prey's path and hope that the prey would continue unaware of the threat. That is the nature of an 'ambush predator'.
That leave an attack from the air and that have been successfully challenged in many discussions on this forum.
Again..You do not know what you are talking about.