This can be achieved easily along the main route, but here is how to achieve it.
After returning to Amethyst and successfully giving her the mushrooms, just continue through the storyline where Pumpkin enters the library
Route:
1. Go right
2. Search for shrooms
Continue through story