Closed Lucaman99 closed 2 years ago
Thanks @Lucaman99!
We are currently thinking about how to implement more cost functions naturally, so this definitely fits.
We're also thinking about whether it makes sense for state
to be a property of the device, or a quantity that is returned (simulators only). In either case, the von Neumann entropy would be a nice candidate for a new cost function
Awesome, I'd love to help out with the implementation of this feature! Is this something you would want to add into Pennylane now, or would you rather wait until it is decided how state
will be defined?
@co9olguy Also, since you're interested in implementing new cost functions, would you be interested in implementing a free energy cost function directly into PennyLane (as well as the entropy)? It would be a very simple extension since the free energy is given by L = 1/T
It also might be worth implementing relative entropy between two states as well! 🙂
All of these sound great. Before we add them though, we'll need to think ahead and plan how/where they fit
@co9olguy Got it, I'm assuming this a change where more people need to be looped-in to the conversation?
Yep, it's on our radar currently
Sounds good!
@Lucaman99 - now that we have qml.state()
, this should pave the way for easily coding this up?
This has been introduced as part of the quantum info module with https://github.com/PennyLaneAI/pennylane/pull/2617.
It might be nice to have a method that can calculate the Von Neumann entropy of some arbitrary state.
I've come across a few papers where a variant of "free energy" is used as a loss function for preparing Gibbs (or Gibbs-like) states [1-3]. This free energy loss function includes both energy expectation and entropy.
I don't think this would be too difficult to implement, we would just have to access
dev.state
, and return -Tr(p ln p).[1] https://arxiv.org/abs/1910.02071 [2] https://arxiv.org/abs/1811.11756 [3] https://arxiv.org/abs/1912.11381