First, if your company has a policy against relationships at work, the very last thing you want to do after a breakup is go tell HR. This could get you fired. If you need to ask for a transfer, do not give the breakup of the relationship as the reason. If there is no formal policy against it, you can talk about why you want a transfer, but do it carefully. You do not want to come across as an angry, out-of-control person.
The problem of the break-up is one of the most critical reasons why relationships at work are discouraged. There can be some awful effects of this and many times the person with the least organizational power is let go. I have seen this happen repeatedly.
There are only two strategies to navigating these waters that I have seen actually work.
The first is to act like an adult and a professional. Treat the other person exactly the same as you should have treated him or her before the relationship. Be polite at all times, praise publicly when the person does something well, discuss problems in private. A professional does not let something like this affect productivity or work performance.
You can be as angry or upset as you like outside of the workplace, it is simply inappropriate in the workplace. If the other person is behaving inappropriately, then let them look bad while you take the high road (it's not as effective as when both parties can take the high road, but it is more effective than both parties being angry and disrupting the workplace). This strategy works best when both parties can follow it and when you are peers - not in a boss-subordinate relationship.
Unfortunately, in a boss-subordinate relationship, the best strategy by far is to reassign one of the people or for one to get another job elsewhere if there are no other jobs to be reassigned to. It is almost impossible for people to work in this kind of relationship after ending a relationship.
One thing that happens after the personal relationship is over is that the boss stops giving special preference to the subordinate. Yes, you think there was no special treatment, but in 30 years in the workplace and having observed many boss-subordinate relationships, I have never yet seen one where there wasn't special treatment that, frankly, the other employees resented.
So the junior person is now going to be held accountable for doing the work in a way that he or she wasn't before and gets mad at the difference. The boss is mad because the person is not the "star" performer he or she thought the person was before (even if he or she still is). The co-workers who have been upset at the special treatment realize that they can take their ire out on that person as well. (I can't say this strong enough even though this is not about beginning a relationship - if the person is your boss, do not start a relationship with him or her, they do not end well.) And it is much, much worse if the person was promoted to a position above his or her competence level due to the relationship or if one of the parties in the relationship is married to someone else.
If you are in the position of a subordinate who broke up with the boss, start looking for something else immediately and do not spend any money you don't have to because there is a good chance you will lose your job before you find another.