Dittos to all the above FatCat. I would just add that a few weeks after surgery, you may find sitting in an upright chair -- in a restaurant for example -- a bit uncomfortable. So, I think you will naturally not want to hop on your bike within the first six to eight weeks.
That's my opinion from my experience.
BUT, if, for some reason, you feel "just great" within a couple of weeks of surgery, stay away from that bike anyway! Trust me. You need to let nature take its course and heal internally. I've heard stories about guys who just couldn't wait to run after their surgeries, play basketball, lift weights etc. and they wound up with problems they shouldn't have had in the first place. You have to take the six-to-eight weeks to heal inside.
So be patient. Before you know it, you'll be back to your old self and ridin' like the wind.
Best to ya,
Tom