I have already solved this
first you must pass the self-awareness test,that is to light the three pillars.
then it will show you three books,to solve the riddle of library ,you must infer to the books..
now I will show you
first:light all the candles except the middle one,until a lightning strikes
second:light only the middle candle,and wait for the lightning
last:light any three candles,and wait for the lightning
the gate will open