Ownership of the code My advisor sets the problem. I implement the solution for this particular problem and for the set of similar problems using a programming language.

My question is, can I put the code in the public domain, if I decide to do so. And can I run the code for other people in exchange of co-authorship for their papers?

Again, my advisor did not ask me to write the code, he asked me to solve the problem.
Most of the universities I've worked for have been quite explicit that they consider such material as "work for hire" meaning that they own the rights. In that case you need to find out what the university policy is.

Often you are allowed to open-source the code, but you have to find out.



I'm in the United States.