Defeat all of the samurai first. Once the courtyard is clear, go to the door and pour all of your remaining chi into it — that is what opens the way.